If you build your custom XML as an org.exolab.castor.types.AnyNode instance, then you can just pass the root level AnyNode to the setMyXmlObj method.

http://www.castor.org/javadoc/org/exolab/castor/types/AnyNode.html

--Keith

Zach Calvert wrote:
I'm curious if there is a way to insert XML into an object being marshaled out by Castor.

Let's say I have just some object that I am inserting into an object that is generated by Castor from an XSD, and that XSD had an xs:any in it. So my object will have a "setAnyObject" function in it. Something like
  <xs:element name="myXmlObj">
     <xs:complexType>
        <xs:sequence>
           <xs:any minOccurs="0"/>
        </xs:sequence>
     </xs:complexType>
  </xs:element>

If I wanted my output to be
<myXmlObj>
  <someDynamic>content</someDynamic>
  <someDynamic2>content</someDynamic2>
</myXmlObj>

How could I do this? Would I have to generate my own XMLClassDescriptor? Is there an easy way to do this, where I could do something like myXmlObj.setAnyObject("MyContent that won't be encoded");? So that the < and > won't show up as &lt; and &gt; in the marshaled output?



Thank you,
Zach

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to