Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > DTD to XML Schema

Reply
Thread Tools

DTD to XML Schema

 
 
NSB
Guest
Posts: n/a
 
      12-09-2005
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 abcyz EMPTY>
<!ATTLIST abcyz parameter CDATA #IMPLIED>

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

Thanks in advance!

Best regards,
Nico

 
Reply With Quote
 
 
 
 
Henry S. Thompson
Guest
Posts: n/a
 
      12-09-2005
NSB writes:

> 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

<xs:element name="search-term" type="xs:anySimpleType"/>


> I've a hugh number of DTD elements with attribut lists looking like
> this sample:
> <!ELEMENT abcyz EMPTY>
> <!ATTLIST abcyz 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: http://www.velocityreviews.com/forums/(E-Mail Removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 
Reply With Quote
 
 
 
 
JAPISoft
Guest
Posts: n/a
 
      12-12-2005
<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


NSB wrote:
> 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 abcyz EMPTY>
> <!ATTLIST abcyz parameter CDATA #IMPLIED>
>
> How can I convert this structures correctly? Specifically EMPTY and
> #IMPLIED.
>
> Thanks in advance!
>
> Best regards,
> Nico
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New to xml schema - does the dtd/schema validation happens always ? pramodr XML 3 04-05-2009 12:10 PM
web.xml / XML schema issue, why do some XML schema attributes disappear asciz@starmail.com Java 3 02-20-2007 09:56 AM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
Validating XML against a DTD that is not supplied in the XML Schema Ben Jessel Java 0 08-05-2004 11:45 AM
ANN: Syntext Dtd2Xs v1.3 - Complex&Modularized XML DTD to XML Schema Converter Syntext, Inc XML 0 08-21-2003 10:50 AM



Advertisments