Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert SGML DTD to XML Schema

Status
Not open for further replies.

jensen2

Programmer
Oct 29, 2004
1
DE
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top