Today I thought a lot about this problem. I considered how strong this xs:all rule is for XML databases to store documents that have not structured "CMS" as data, as well as validating the data.
Then it occurred to me that XHTML allows you to very flexibly place nested elements in any order in which you need to mark the page.
So here is an excerpt from the XHTML 1.1 schema:
<xs:group name="InlForm.class"> <xs:choice> <xs:element ref="input"/> <xs:element ref="select"/> <xs:element ref="textarea"/> <xs:element ref="label"/> <xs:element ref="button"/> </xs:choice> </xs:group> <xs:group name="Inline.extra"> <xs:choice/> </xs:group> <xs:group name="Ruby.class"> <xs:sequence> <xs:element ref="ruby"/> </xs:sequence> </xs:group> <xs:group name="Inline.class"> <xs:choice> <xs:group ref="InlStruct.class"/> <xs:group ref="InlPhras.class"/> <xs:group ref="InlPres.class"/> <xs:group ref="I18n.class"/> <xs:group ref="Anchor.class"/> <xs:group ref="InlSpecial.class"/> <xs:group ref="InlForm.class"/> <xs:group ref="Ruby.class"/> <xs:group ref="Inline.extra"/> </xs:choice> </xs:group> <xs:group name="Heading.class"> <xs:choice> <xs:element ref="h1"/> <xs:element ref="h2"/> <xs:element ref="h3"/> <xs:element ref="h4"/> <xs:element ref="h5"/> <xs:element ref="h6"/> </xs:choice> </xs:group>
They essentially nest in the choice of groups, recursively. I believe that the person who wrote this lives the rest of his days in a safe facility, receiving compulsory medications several times a day.
Hope this helps. I think this illustrates how super-flexi schemes actually execute in XSD 1.0.
Change - it works! You can create a βcoreβ group of all other groups and use this example ListItem element ListItem to allow continuous nested elements in any order. Make sure ListItem also included in the group, so recursion works.
<xs:element name="ListItem"> <xs:complexType> <xs:sequence> <xs:group ref="content:any.mix" minOccurs="1" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element>
So my group any.mix looks like this:
<xs:group name="any.mix"> <xs:choice> <xs:group ref="content:item.class" /> <xs:group ref="content:media.class" /> <xs:group ref="content:data.class" /> <xs:group ref="content:list.class" /> </xs:choice> </xs:group>
And each of these class groups contains even more group options, etc. etc., until they ultimately hit the elements, the actual sheet-level tags, if you want.
Groups themselves should not have circular references; the "trick" is in unlimited occurrences of the any.mix group, i.e. in the form of a tree of options with an unlimited choice of root.
Luke