logo       

Re: XmlBeans and sequence....: msg#00130

text.xml.xmlbeans.user

Subject: Re: XmlBeans and sequence....

You can use the DOM, but this scenario is one of the reasons that
XmlCursor exists.

- Eric

> Hi,
> I've generated bindings for the following schema...
> ======================================
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- edited with XMLSPY v2004 rel. 4 U
> (http://www.xmlspy.com) by Sudesh Shetty (Borland) -->
> <xs:schema elementFormDefault="qualified"
> attributeFormDefault="unqualified"
> xmlns:xs="http://www.w3.org/2001/XMLSchema";>
> <xs:element name="root">
> <xs:annotation>
> <xs:documentation>Test </xs:documentation>
> </xs:annotation>
> <xs:complexType>
> <xs:sequence>
> <xs:element name="level1"
> maxOccurs="unbounded"/>
> <xs:sequence minOccurs="0" maxOccurs="unbounded">
> <xs:element name="level2" minOccurs="0"/>
> <xs:element name="level22"
> maxOccurs="unbounded"/>
> </xs:sequence>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> ===============================
> the bindings that generated has the following api's
> Root.getLevel1Array()
> Root.getLevel2Array()
> Root.getLevel22Array()
> ...
>
> The problem I'm facing is given an xml instance of
> ================
> <?xml version="1.0" encoding="UTF-8"?>
> <!--Sample XML file generated by XMLSPY v2004 rel. 4 U
> (http://www.xmlspy.com)-->
> <root
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:noNamespaceSchemaLocation="C:\work\test.xsd">
> <level1>Text</level1>
> <level2>Text</level2>
> <level22>Text</level22>
> <level22>Text</level22>
>
> <level2>Text</level2>
> <level22>Text</level22>
> <level22>Text</level22>
> <level22>Text</level22>
> </root>
> ========================
> How do I associate the sequencing of levl2 and level22
> elements. Lets say I want to display ech of the
> level2/level22 sequences in their own
> groups/messageboxes. If I do Root.getLevel2Array()
> then I get all the level2 elements and I ave no way of
> grouping them with their corresponding level22
> counterparts. How does one achive this without using
> the cursors ?
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Helps protect you from nasty viruses.
> http://promotions.yahoo.com/new_mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xxxxxxxxxxxxxxxxxxx
> For additional commands, e-mail: user-help@xxxxxxxxxxxxxxxxxxx
>


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise