You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by PianoJaG83 <jg...@gmail.com> on 2008/07/31 17:17:40 UTC
SchemaParticle content model for single children
I've noticed that getContentModel() on a SchemaParticle with only one child
will return a SchemaLocalElement instead of a sequence containing one child.
For example, consider:
<xs:complexType name="MyComponentType">
<xs:complexContent>
<xs:extension base="base:ComponentType">
<xs:sequence>
<xs:element name="childElement" type="domain:ChildType" nillable="true"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
If myComponentType represents the SchemaType for MyComponentType, then
myComponentType.getContentModel() returns a SchemaLocalElement named
childElement. I would expect the content model to be a SchemaParticleImpl
with a particle type of SEQUENCE.
Doesn't this alter the semantics of the XML structure? If I have some code
that expects to treat sequences differently from elements, this would break
it.
--
View this message in context: http://www.nabble.com/SchemaParticle-content-model-for-single-children-tp18756901p18756901.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org