xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikhil Dinesh <nikh...@seas.upenn.edu>
Subject order of elements in a sequence
Date Mon, 05 Jul 2004 21:12:23 GMT
Hi,

Im having trouble getting XmlBeans to save the elements of a sequence in
order. I have a complex type defined similar to the following:

<complexType name="fooId>
  <attribute name="id" type="ID" />
</complexType>

<complexType name="fooId2">
  <complexContent>
    <extension base="fooId">
      <attribute name="type" type="string" />
    </extension>
  </complexContent>
</complexType>

<complextType name="fooInstance">
  <complexContent>
    <extension base="fooId">
      <sequence>
        <element name="a" type="fooId" minOccurs="0" maxOccurs="unbounded"/>
        <element name="b" type="fooId2" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
    </extension>
  </complexContent>
</complexType>

A file is read in such that all the "<a>'s" occur before the "<b>'s". This
is done by messaging the contentHandler. But when I try to save it, the
a's and b's are interspersed.

Ive tried setting minOccurs=maxOccurs=1 on the sequence element. Doesnt
that guarantee that it will be split into atmost one subsequence as per
the W3c recommendation? But that doesnt work either.

The sequence order is needed because the persistent form of the XML needs
to be compatible with a DTD. I could of course walk over the tree, but
that seems like a very bad solution.

Any suggestions?

Thanks,
Nikhil



- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Mime
View raw message