xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Campana Jr., Salvatore J" <sal.camp...@hp.com>
Subject RE: How to add SOAPElements to xsd:any portion of XmlObject
Date Wed, 14 Jul 2004 15:32:01 GMT
I can can convert my SOAPElements to XmlObjects....That isn't an
It's more along the lines of what Ian posted in that it would be nice to
be able to get at that "any" element in the structure and add XmlObjects
to the array...
In the case you site, I am not entirely sure how to go about things....
Should i:
1.  use a cursor on the document to be inserted into. (foo)
2. then convert the SOAPEleemnt into an XmlObject (soapfoo)
3. then use a cursor on the new XmlObject (soapfoo)
4. then call on foo's cursor.copyXml and pass the other cursor to it???
Is that what copyXml is meant to do??


From: Eric Vasilik [mailto:ericvas@bea.com] 
Sent: Wednesday, July 14, 2004 11:18 AM
To: xmlbeans-user@xml.apache.org
Subject: RE: How to add SOAPElements to xsd:any portion of XmlObject

XmlCursor is how content is interrogated/manipulated when a Schema does
not provide enough information for generated classes to be generated (as
is the case with xs:any).
You might be able to use a combination of XmlCursor and the
XmlObject.set to construct the desired document.  Also, you can use
XmlCursor to move content from one doc to another for the same purposes.
Are your soap elements XmlBeans, or is this SAAJ?
- Eric
-----Original Message-----
From: Campana Jr., Salvatore J [mailto:sal.campana@hp.com] 
Sent: Tuesday, July 13, 2004 2:41 PM
To: xmlbeans-user@xml.apache.org
Subject: 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
Here is a snippet of the schema:
<xsd:complexContent name="foo">
      <xsd:any minOccurs="0" maxOccurs="unbounded"/>
<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
sal_campana@hp.com <mailto:sal_campana@hp.com>  

View raw message