You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-user@xml.apache.org by "Campana Jr., Salvatore J" <sa...@hp.com> on 2004/07/13 23:41:08 UTC
How to add SOAPElements to xsd:any portion of XmlObject
I have generated an XmlBean for a schema which contains an element which
is of type xsd:any. I am trying to determine the easiest way to insert
some SOAPElement objects into the XmlBean into this xsd:any field.
(Note. I can convert the SOAPElements to String or DOM)
It seems as though a XmlCursor may provide a way to do it, but I am not
sure....
Here is a snippet of the schema:
<xsd:complexContent name="foo">
<xsd:sequence>
<xsd:any minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexContent>
<xsd:element name="FooBar" type="foo"/>
While a FooBar is generated, there is no direct way (from what I can
tell) in which I can add to the "any"....A XMLCursor will allow me to
create an element and add text, but since I do not know what type the
MessageElements will be, it becomes an exercise in walking all the
elements in the MessageElement structure to add the xml....Is there and
easier way?
________________________________
Sal Campana
HP Software
856.638.6284
sal_campana@hp.com <ma...@hp.com>
<ma...@hp.com>