I know the whole point of an XSD is to define the structure of the the XML, but is it possible to let a child be any valid XML? For example:
If I have this XSD
<xsd:complexType name="soExample">
<xsd:all>
<xsd:element name="field1" type="xsd:integer" />
</xsd:all>
</xsd:complexType>
A valid XML is
<soExample>
<field1>25</field1>
</soExample>
Now I want a special field field2
which allows me to put any XML that can be parsed inside, XSD would look like:
<xsd:complexType name="soExample">
<xsd:all>
<xsd:element name="field1" type="xsd:integer" />
<xsd:element name="field2" type="so:special" />
</xsd:all>
</xsd:complexType>
And a valid XML would be:
<soExample>
<field1>25</field1>
<field2>
<anything>3</anything>
</field2>
</soExample>
or
<soExample>
<field1>25</field1>
<field2>
<cars>
<favorite>"miata"</favorite>
</cars>
</field2>
</soExample>
I have a feeling this isn't possible because there's not a good way to resolve the types... but worth asking.