OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   converting XML Schema to DTD

[ Lists Home | Date Index | Thread Index ]

I need help in converting the following schema to DTD. The schema depicts a
simple case of personnel element with fname and lname using xs:all. Pl. see
below
DTD generated by XML Spy does not seem to be correct.

SCHEMA:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
elementFormDefault="qualified">
<xs:element name="fname" type="xs:string"/>
<xs:element name="lname" type="xs:string"/>
<xs:element name="personnel">
<xs:complexType>
<xs:all>
<xs:element ref="lname" minOccurs="0"/>
<xs:element ref="fname" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>

DTD generated by XML Spy:

<?xml version="1.0" encoding="UTF-8"?>
<!--DTD generated by XML Spy v4.2 U (http://www.xmlspy.com)-->
<!ELEMENT fname (#PCDATA)>
<!ELEMENT lname (#PCDATA)>
<!ELEMENT personnel (lname?, fname?)>


this is not correct because the XML below is INVALID with the DTD but valid
with the SCHEMA.

<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XML Spy v4.2 U (http://www.xmlspy.com)-->
<personnel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="D:\dtd2xs\try.xsd">
	<fname>String1</fname>
	<lname>String2</lname>
</personnel>





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS