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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help on converting DTD TO SCHEMA

Status
Not open for further replies.

FG1984

Technical User
Aug 16, 2008
1
Can someone convert this dtd to schema please, I am so confused. I look at some converters on the net but they all confused me. Please HELP.

<!ELEMENT all_recipes (recipe+)>

<!ELEMENT recipe (type,name,nationality,all_ingredients)>

<!ELEMENT type (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT nationality (#PCDATA)>

<!ELEMENT all_ingredients (ingredient+)>

<!ELEMENT ingredient (#PCDATA)>
 
This is nearly a textbook exercise... but I think I can understand what is meant by "confused" and that it is not going to go away easily in the time to come.
[tt]
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema version="1.0" xmlns:xs="[ignore][/ignore]">
<xs:element name="all_recipes">
<xs:complexType>
<xs:sequence>
<xs:element name="recipe" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="type" type="xs:string" />
<xs:element name="name" type="xs:string" />
<xs:element name="nationality" type="xs:string" />
<xs:element name="all_ingredients">
<xs:complexType>
<xs:sequence>
<xs:element name="ingredient" type="xs:string" minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top