Keith,
   Works fine for me too,
Thanks,
Ilias

Keith Visco wrote:

Hi Ilias,

I checked in a patch to CVS for this, it's working for my test case, let
me know how it works for you.

Thanks,

--Keith


Keith Visco wrote:


Hi Ilias,

Unfortunately, it looks like you're right, my test case is also failing.
I'll try to get a patch checked into CVS shortly.

Thanks,

--Keith

Ilias Stergiou wrote:


Keith thank you for the hints. Unfortunately the problem was not solved
but became more interesting. When I am trying to unmarshall and then
marshall, the element:
[input]
<name xml:lang="en">Ilias</name>
using the mapping:
[mapping]
<mapping xmlns:cst="http://castor.exolab.org/";
xmlns:xml="http://www.w3.org/XML/1998/namespace";>
...
   <class cst:name="org.uddi4j.datatype.Name"
xmlns:xml="http://www.w3.org/XML/1998/namespace";>
       <map-to cst:xml="name" cst:ns-uri="urn:uddi-org:api_v2"/>
       <field cst:name="lang" cst:type="java.lang.String">
           <bind-xml name="lang" node="attribute"/>
       </field>
       <field cst:name="text" cst:type="java.lang.String">
           <bind-xml name="text" node="text"/>
       </field>
   </class>
I get
[output]
<name lang="en">Ilias</name>

Unmarshalling worked but marshalling failed to add namespace...

When I am doing the same changing the class/field/bind-xml name="lang"
mapping line to
[mapping]
           <bind-xml name="xml:lang" node="attribute"/>
I get
<name>Ilias</name>

Unmarshalling failed. (I have verified that marshalling is working with
that mapping)
I have tried the checked-out CVS version using both xerces 2.6 and 1.4
Ilias

Keith Visco wrote:



Ilias,

If the work-around is not working for you, then the best solution is to
update your version of Castor to the CVS version (which contains a
built-in workaround) and it should work fine.

--Keith


Ilias Stergiou wrote:





Hello,
  I am trying to unmarshall the attribute xml:lang="en" using
instructions found on the list without success (marshalling works fine).
The XML file is:

<?xml version="1.0" encoding="UTF-8"?>
<businessEntity xsi:schemaLocation="urn:uddi-org:api_v2
http://www.uddi.org/schema/uddi_v2.xsd"; xmlns="urn:uddi-org:api_v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <name xml:lang="en">European Dynamics</name>
  <description xml:lang="en">European Dynamics sa</description>
</businessEntity>

The mapping is:

<mapping xmlns:cst="http://castor.exolab.org/";
xmlns:xml="http://www.w3.org/XML/1998/namespace";>
  <class cst:name="org.uddi4j.datatype.Name"
xmlns:xml="http://www.w3.org/XML/1998/namespace";>
      <map-to cst:xml="name" cst:ns-uri="urn:uddi-org:api_v2"/>
      <field cst:name="lang" cst:type="java.lang.String">
          <bind-xml name="xml:lang" node="attribute"/>
      </field>
      <field cst:name="text" cst:type="java.lang.String">
          <bind-xml name="text" node="text"/>
      </field>
  </class>
....
</mapping>

using options:

marshaller.setSchemaLocation("urn:uddi-org:api_v2
http://www.uddi.org/schema/uddi_v2.xsd";);

I am using castor-0.9.5.2-xml and xerces 2.6 and have set
org.exolab.castor.parser.namespaces=true

I have also tried xerces 1.4.4. It complains about trying to define
namespace xml. Removing xmlns:xml="http://www.w3.org/XML/1998/namespace";
I get the sampe disappointing result...

Any hint is appreciated...
Thanks,
Ilias



----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev




Reply via email to