How can I have sub-elements of a complex/mixed type with unrestricted order and count?
- by mbmcavoy
I am working with XML where some elements will contain text with additional markup. This is similar to this example at W3Schools. However, I need the markup tags to be able to appear in any order and possibly more than once.
To modify their example for illustration:
<letter>
Dear Mr.<name>John Smith</name>.
Your order <orderid>1032</orderid>
will be shipped on <shipdate>2001-07-13</shipdate>.
Thank you, <name>Bob Adams</name>
</letter>
None of the options presented by W3Schools (on the page following the linked example) allow this XML due to the second <name> element. Their explanation of the "indicators" and my testing are consistent.
<xs:sequence> - violates the element order
<xs:choice> - more than one kind of element is used.
<xs:all> - maxOccurs is restricted to "1".
This seems like it should be basic, after all, XHTML allows such things. How do I define my schema to allow this?