Does XSD allow simpleContent and complexContent at the same time?
I want to write an xsd for the xmlrpc spec (and generate java classes out of it using jaxb). The xmlrpc spec allows values like:
<value><int>123</int></value>
<value><boolean>1</boolean></value>
But at the same time it requires:
If no type is indicated, the type is string.
Which means i could receive something like this:
<value>test123</value>
which is equivalent to
<value><string>te开发者_如何学Pythonst123</string></value>
Is there a way to define this in an xsd.
Yes, set a mixed content model on value
:
<xs:complexType name="valuetype" mixed="true">
<xs:sequence>
<xs:element name="int" type="xs:int"/>
<xs:element name="boolean" type="xs:boolean"/>
...
</xs:sequence>
</xs:complexType>
精彩评论