I want to define a complex type via XSD that
- can contain inner text
- can contain inner elements
- text and elements can be freely mixed without order constraints
- elements can appear zero or multiple times
That's what the body element of XHTML allows. E.g:
<body>
Hello <b>World</b>, nice <span>to</span> <b>meet</b> you<b>!!!</b>
</body>
Looking at the element composition constraints like sequence, all or choice that doesn't seem to be possible with XSD.
But on the other hand, XHTML, as a valid XML language, should be describable by an XSD schema.
So any ideas how I could describe such complex types? Thank you in advance...
<span>
or<b>
may contain lots of other elements (including themselves) as well as text. This is done typically using element groups:<xs:group>
. Just look how they do it for XHTML. Here's the full schema for it: w3.org/2002/08/xhtml/xhtml1-strict.xsd . If it is difficult to read, you can use some freely available XML schema documentation generator. – ColdFusion