DTD to XML Schema

N

NSB

Hi all!

I've two questions about converting a DTD to a XML schema

Is the following conversion correct:
DTD (source):
<!ELEMENT uug-query:search-term (#PCDATA)>

Schema:
<xs:complexType name="search-term" type="general">
<xs:choise minOccurs="0" maxOccures="unbound"/>
</xs:complexType>
<xs:ekement name="search-term" type="search-term"/>

I've a hugh number of DTD elements with attribut lists looking like
this sample:
<!ELEMENT abc:xyz EMPTY>
<!ATTLIST abc:xyz parameter CDATA #IMPLIED>

How can I convert this structures correctly? Specifically EMPTY and
#IMPLIED.

Thanks in advance!

Best regards,
Nico
 
H

Henry S. Thompson

NSB said:
Is the following conversion correct:
DTD (source):
<!ELEMENT uug-query:search-term (#PCDATA)>

Schema:
<xs:complexType name="search-term" type="general">
<xs:choise minOccurs="0" maxOccures="unbound"/>
</xs:complexType>
<xs:ekement name="search-term" type="search-term"/>

For this you want

<xs:complexType name="search-term" mixed="true"/>

or simply say

I've a hugh number of DTD elements with attribut lists looking like
this sample:
<!ELEMENT abc:xyz EMPTY>
<!ATTLIST abc:xyz parameter CDATA #IMPLIED>

How can I convert this structures correctly? Specifically EMPTY and
#IMPLIED.

<xs:element name="xyz" type="xyz"/>
<xs:complexType name="xyz">
<xs:attribute name="parameter"/>
</xs:complexType>

Since no content model, must be EMPTY.
Attribute defaults to optional==#IMPLIED and
type="xs:anySimpleType"==CDATA.

Suggest you read the XML Schema primer [1].

ht

[1] http://www.w3.org/TR/xmlschema-0/
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: (e-mail address removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 
J

JAPISoft

<xsd:element name="xyz">
<xsd:complexType>
<xsl:attribute name="parameter" type="xsd:string"/>
</xsd:complexType>
</xsd:element>

Best regards,

A.Brillant
EditiX - XML Editor and XSLT Debugger
http://www.editix.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top