Hello,

Given the following sample XML:

<my_ns:PARENT_ELEMENT _parentAttr1="pVa11" _parentAttr2="pVal2">
   <my_ns:CHILD_ELEMENT _childAttr1="cVal1" _childAttr2="cVal2"/>
       <my_ns:GRANDCHILD_ELEMENT _grandchildAttr1="gcVal1"
_grandchildAttr2="gcVal2"/>
   </my_ns:CHILD_ELEMENT>
</my_ns:PARENT_ELEMENT>

I have gotten this mapping to work properly for BOTH marshalling AND
unmarshalling:

 <class name="com.xyz.MyClass">
   <map-to xml="PARENT_ELEMENT"
           ns-uri="http://www.xyz.com/xsd/MySchema";
           ns-prefix="my_ns"/>
   <field name="childAttr1"
          type="java.lang.String">
     <bind-xml name="_childAttr1" location="CHILD_ELEMENT"
node="attribute"/>
   </field>
 </class>

Whereas this mapping works on unmarshalling, but NOT on marshalling:

 <class name="com.xyz.MyClass">
   <map-to xml="PARENT_ELEMENT"
           ns-uri="http://www.xyz.com/xsd/MySchema";
           ns-prefix="my_ns"/>
   <field name="grandChildAttr1"
          type="java.lang.String">
     <bind-xml name="_grandchildAttr1"
location="CHILD_ELEMENT/GRANDCHILD_ELEMENT" node="attribute"/>
   </field>
 </class>


Notice the location attribute on the second mapping.  I assume there is
a limitation on castor for marshalling more than one level deep via use
of the location attribute?  Is there a way to work around this so that I
can expand an object into more than one level of nesting during marshalling?

Many thanks in advance,

Jason


-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to