Hello,
I want to convert the SGML DTD syntax "<!ELEMENT Test (#PCDATA | Element1 | Element2)+>" to XML Schema Syntax.
I tried it with this syntax but there is text not mandatory:
<xs:element name="Test">
<xs:complexType mixed="true">
<xs:choice maxOccurs="unbounded">
<xs:element ref="Element1"/>
<xs:element ref="Element2"/>
</xs:choice>
</xs:complexType>
</xs:element>
The following xml syntax should be valid:
<Test>Text</Test> or
<Test><Element1/>Text</Test> or
<Test><Element1/><Test>
But not:
<Test></Test>
How will it be written, that text has to be mandatory?
Thanks Jens.
I want to convert the SGML DTD syntax "<!ELEMENT Test (#PCDATA | Element1 | Element2)+>" to XML Schema Syntax.
I tried it with this syntax but there is text not mandatory:
<xs:element name="Test">
<xs:complexType mixed="true">
<xs:choice maxOccurs="unbounded">
<xs:element ref="Element1"/>
<xs:element ref="Element2"/>
</xs:choice>
</xs:complexType>
</xs:element>
The following xml syntax should be valid:
<Test>Text</Test> or
<Test><Element1/>Text</Test> or
<Test><Element1/><Test>
But not:
<Test></Test>
How will it be written, that text has to be mandatory?
Thanks Jens.