Converting DTDs to XML Schemas (2/3) - exploring XML | WebReference

Converting DTDs to XML Schemas (2/3) - exploring XML

Converting DTDs to XML Schemas

The converted RSS DTD

The translation comes out as follows:

<schema
  xmlns='http://www.w3.org/1999/XMLSchema'
  targetNamespace='http://purl.org/rss/0.91'
  xmlns:rss='http://purl.org/rss/0.91'>
 <element name='rss'>
  <complexType content='elementOnly'>
   <element ref='rss:channel'/>
   <attribute name='version' type='string' use='required'/>
  </complexType>
 </element>
 <element name='channel'>
  <complexType content='elementOnly'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='rss:title'/>
    <element ref='rss:description'/>
    <element ref='rss:link'/>
    <element ref='rss:language'/>
    <element ref='rss:item'/>
    <element ref='rss:+'/>
    <element ref='rss:rating'/>
    <element ref='rss:?'/>
    <element ref='rss:image'/>
    <element ref='rss:?'/>
    <element ref='rss:textinput'/>
    <element ref='rss:?'/>
    <element ref='rss:copyright'/>
    <element ref='rss:?'/>
    <element ref='rss:pubDate'/>
    <element ref='rss:?'/>
    <element ref='rss:lastBuildDate'/>
    <element ref='rss:?'/>
    <element ref='rss:docs'/>
    <element ref='rss:?'/>
    <element ref='rss:managingEditor'/>
    <element ref='rss:?'/>
    <element ref='rss:webMaster'/>
    <element ref='rss:?'/>
    <element ref='rss:skipHours'/>
    <element ref='rss:?'/>
    <element ref='rss:skipDays'/>
    <element ref='rss:?'/>
   </choice>
  </complexType>
 </element>
 <element name='title'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='description'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='link'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='image'>
  <complexType content='elementOnly'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='rss:title'/>
    <element ref='rss:url'/>
    <element ref='rss:link'/>
    <element ref='rss:width'/>
    <element ref='rss:?'/>
    <element ref='rss:height'/>
    <element ref='rss:?'/>
    <element ref='rss:description'/>
    <element ref='rss:?'/>
   </choice>
  </complexType>
 </element>
 <element name='url'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='item'>
  <complexType content='elementOnly'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='rss:title'/>
    <element ref='rss:link'/>
    <element ref='rss:description'/>
   </choice>
  </complexType>
 </element>
 <element name='textinput'>
  <complexType content='elementOnly'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='rss:title'/>
    <element ref='rss:description'/>
    <element ref='rss:name'/>
    <element ref='rss:link'/>
   </choice>
  </complexType>
 </element>
 <element name='name'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='rating'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='language'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='width'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='height'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='copyright'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='pubDate'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='lastBuildDate'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='docs'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='managingEditor'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='webMaster'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='hour'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='day'>
  <complexType content='mixed'>
  </complexType>
 </element>
 <element name='skipHours'>
  <complexType content='elementOnly'>
   <element ref='rss:hour' maxOccurs='unbounded'/>
  </complexType>
 </element>
 <element name='skipDays'>
  <complexType content='elementOnly'>
   <element ref='rss:day' maxOccurs='unbounded'/>
  </complexType>
 </element>
</schema>

It's obvious that some manual work is needed.

http://www.internet.com

Produced by Michael Claßen

URL: http://www.webreference.com/xml/column35/2.html
Created: Jul 18, 2001
Revised: Jul 18, 2001