Hi Stefan,

I'm confused by your statement. Elements in a <sequence> most definitely *are* ordered. Does this mean that XMLBeans ignores nested compositors?

 - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Stefan Offermann wrote:
Maya Dahan schrieb:
I am trying to work/populate the following XSD:
                    <xs:sequence maxOccurs="unbounded">
<xs:element name="nameElement" type="xs:string"/>
                        <xs:element name="nameValue" type="xs:string"/>
                    </xs:sequence>

The generated XML is not valid:
<Name>
    <NameValue>NameValue</NameValue>
    <NameValue>NameValue1</NameValue>
    <NameElement>Name</NameElement>
    <NameElement>Name1</NameElement>
</Name>

The generated xml *is* valid!

It should be:
<Name>
    <NameValue>NameValue</NameValue>
    <NameElement>Name</NameElement>
    <NameValue>NameValue1</NameValue>
    <NameElement>Name1</NameElement>
</Name>

Any ideas? Is this a bug? Is it fixed in a newer version of XMLBeans?

It is "by-design" because elements in a sequence (your NameValue and NameElement) are *not* *ordered*. If you want to have Element-Value-pairs you should declare a new type in your schema which will have 1 element and 1 value, this new type can then be unbounded in you name-type.

hope that helps, Stefan


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to