W3C home > Mailing lists > Public > www-math@w3.org > April 2002

Re: [Moderator Action] DESPERATION: Trying to include the DTD into a schema!

From: Max Froumentin <mf@w3.org>
Date: Mon, 08 Apr 2002 23:13:03 +0200
To: Carlos Merighe <CMerighe@natr.com>
Cc: "'ion@math.ams.org'" <ion@math.ams.org>, "'www-math@w3.org'" <www-math@w3.org>
Message-ID: <877knhki74.fsf@sophia.inria.fr>
Carlos Merighe <CMerighe@natr.com> writes:

> it does not tell me whether or not I can include the elements from
> the DTD for mathml in a schema (xsd) file.

Hi Carlos,

You can always include MathML elements in a schema of course, but your
problem seems to be about DTD/XML schema validation

From the code you sent, it seems that what you want is to define a schema
using some elements from MathML.

> 	     <xsd:element ref="mml:mrow"/>

This means that you are re-using the element called mml:row in your 
XCOMM type. In order to make this work there must be a definition of 
mml:row somewhere in your schema (or in a schema linked from yours).
Something like:

<xsd:element name="mml:row" type="..."/>

The information provided by the above statement cannot be inferred
from the DTD. Both DTDs and XML Schemas have similar purposes, in
particular validation, but they are not interoperable in that way.

Either you want to write a schema for the MathML elements you need, or
you can wait for the Math Working Group to finish writing a complete
schema for MathML (due sometime soon). Then you will be able to refer
to the declarations in the MathML schema within your schema, with something

<include schemaLocation="http://www.example.org/schema.xsd"/>

> <?xml version="1.0"?>
> <!DOCTYPE mml:math 
>     SYSTEM "mathml2.dtd" [
>     <!ENTITY % MATHML.prefixed "INCLUDE">
>     <!ENTITY % MATHML.prefix "mml">
> ]>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>             targetNamespace="http://www.nsp.com/XCOMM1.0"
>             xmlns="http://www.nsp.com/XCOMM1.0"	    
>             elementFormDefault="qualified">
> PROBLEM:  XML Spy does not recognize <xsd:element ref="mml:mrow"/>

Yes, because the DOCTYPE above adds nothing to your schema definition,
but it makes it invalid XML as it declares your schema itself as a
MathML document, something you clearly don't want to do.

Hope this helps,

Received on Monday, 8 April 2002 17:13:43 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:27:32 UTC