Re: DTD to Schema converter

Jeni,

I think we don't need the "mixed" attribute because what I read about
ANY for DTD is:

An element with content model  'ANY ' specifies that the element matches any
kind of child elements that have been declared.

Note that there is a mixed type in DTD specified as:
    <!ELEMENT name1 (#PADATA | name2 | ...)*>

Thx,

-Stanley

> Re: DTD to Schema converter
>
> From: Jeni Tennison (jeni@jenitennison.com)
> Date: Mon, Dec 03 2001
>
> *Next message: Gary Robertson: "W3C Schema website intro"
>
>    * Previous message: Stanley Guan: "Re: DTD to Schema converter"
>    * In reply to: Stanley Guan: "Re: DTD to Schema converter"
>    * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>    * Other mail archives: [this mailing list] [other W3C mailing lists]
>    * Mail actions: [ respond to this message ] [ mail a new topic ]
>
>   ------------------------------------------------------------------------
>
> Date: Mon, 3 Dec 2001 19:28:07 +0000
> From: Jeni Tennison <jeni@jenitennison.com>
> Message-ID: <1943105024.20011203192807@jenitennison.com>
> To: Stanley Guan <Stanley.Guan@oracle.com>
> CC: xmlschema-dev@w3.org
> Subject: Re: DTD to Schema converter
>
> Hi Stanley,
>
> > So, the conversion from DTD to Schema for the following statement
> >    <!ELEMENT abc ANY>
> > should be
> >     <xs:element name="abc">
> >       <xs:complexType>
> >         <xs:complexContent>
> >           <xs:restriction base="xs:anyType">
> >              <xs:sequence minOccurs=0 maxOccurs="unbounded">
> >                <any namespace="##local"/>
> >              </xs:sequence>
> >              <!-- any declared attributes for "abc" comes here -->
> >           </xs:restriction>
> >         </xs:complexContent>
> >       </xs:complexType>
> >     </xs:element>
>
> You missed off the mixed attribute from xs:complexType - it needs to
> be mixed to allow character data as well as element children. Also,
> technically ANY permits *any* elements as children, not just ones in
> the target namespace of the schema (since DTDs don't have a concept of
> target namespaces). So I'd say it was:
>
> <xs:element name="abc">
>   <xs:complexType mixed="true">
>     <xs:sequence minOccurs="0" maxOccurs="unbounded">
>       <xs:any />
>     </xs:sequence>
>   </xs:complexType>
> </xs:element>
>
> (Using the slightly shorter syntax rather than an explicit restriction
> of xs:anyType.)
>
> > BTW, does anyone have already implemented the mentioned DTD to
> > Schema converter? Any paper discusses all the rules for the
> > conversion?
>
> See http://puvogel.informatik.med.uni-giessen.de/dtd2xs/. There may be
> others - this was just from a quick look at the XML Schema page at
> W3C: http://www.w3.org/XML/Schema.html.
>
> Cheers,
>
> Jeni
>
> ---
> Jeni Tennison
> http://www.jenitennison.com/
>
>   ------------------------------------------------------------------------
>
>    * Next message: Gary Robertson: "W3C Schema website intro"
>    * Previous message: Stanley Guan: "Re: DTD to Schema converter"
>    * In reply to: Stanley Guan: "Re: DTD to Schema converter"
>    * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>    * Other mail archives: [this mailing list] [other W3C mailing lists]
>    * Mail actions: [ respond to this message ] [ mail a new topic ]

Received on Wednesday, 5 December 2001 15:42:14 UTC