Page 1 of 1

Failure to validate MathML Schema

Posted: Wed May 21, 2003 9:34 pm
by dsugar
I'm trying to write an XSD for a project I'm going to be working on. There are going to be MathML islands in this content. When I attempt to validate the MathML Schema (downloaded from http://www.w3.org/Math/XMLSchema/). When I open up my xsd file which imports the mathml2.xsd from the distribution and attempt to vaidate in oxygen I get the error:

- [ constructs.xsd] E cos-nonambig: "http://www.w3.org/1998/Math/MathML":cn and "http://www.w3.org/1998/Math/MathML":cn (or elements from their substitution group) violate "Unique Particle Attribution". (50:32)

It turns out that I can comment out a piece of XSD in constructs.xsd and it then validates - though I'm not sure if the XSD is still correctly describing MathML.

Any suggestions? I don't have anything else to test this with to see if it is a problem in oxygen or a problem with the MathML Schema.

Thanks
Dave Sugar
dsugar at dolphinsoft dot com

Posted: Thu May 22, 2003 1:57 pm
by george
Dear Dave,

The error is reported at:

Code: Select all


<xs:complexType name="fn.type">
<xs:group ref="fn.content"/> <!-- here -->
<xs:attributeGroup ref="fn.attlist"/>
</xs:complexType>
following to fn.content definition we will find:

Code: Select all


<xs:group name="fn.content">
<xs:choice>
<xs:group ref="Content-expr.class"/>
<xs:group ref="Presentation-expr.class"/>
</xs:choice>
</xs:group>
Now looking at Content-expr.class and Presentation-expr.class groups we see that they have equivalent content:

Code: Select all



<xs:group name="Presentation-expr.class">
<xs:choice>
<xs:group ref="PresExpr.class"/>
<xs:group ref="ContExpr.class"/>
</xs:choice>
</xs:group>

<xs:group name="Content-expr.class">
<xs:choice>
<xs:group ref="ContExpr.class"/>
<xs:group ref="PresExpr.class"/>
</xs:choice>
</xs:group>
Thus the first element reference that will appear in the expanded groups will cause the Unique Particle Attribution (UPA) to fail. This is cn as you can see from the code below:

Code: Select all


<xs:group name="PresExpr.class">
<xs:choice>
<xs:group ref="Presentation-token.class"/>
<xs:group ref="Presentation-layout.class"/>
<xs:group ref="Presentation-script.class"/>
<xs:group ref="Presentation-table.class"/>
<xs:element ref="mspace"/>
<xs:element ref="maction"/>
<xs:element ref="merror"/>
<xs:element ref="mstyle"/>
</xs:choice>
</xs:group>

<xs:group name="ContExpr.class">
<xs:choice>
<xs:group ref="Content-tokens.class"/><!-- cn is referred here -->
<xs:group ref="Content-arith.class"/>
<xs:group ref="Content-functions.class"/>
<xs:group ref="Content-logic.class"/>
<xs:group ref="Content-constants.class"/>
<xs:group ref="Content-sets.class"/>
<xs:group ref="Content-relations.class"/>
<xs:group ref="Content-elementary-functions.class"/>
<xs:group ref="Content-calculus.class"/>
<xs:group ref="Content-linear-algebra.class"/>
<xs:group ref="Content-vector-calculus.class"/>
<xs:group ref="Content-statistics.class"/>
<xs:group ref="Content-constructs.class"/>
<xs:element ref="semantics"/>
</xs:choice>
</xs:group>

Code: Select all


<xs:group name="Content-tokens.class">
<xs:choice>
<xs:element ref="cn"/>
<xs:element ref="ci"/>
<xs:element ref="csymbol"/>
</xs:choice>
</xs:group>
If you will comment out one of the fn.content entries and have something like:

Code: Select all

 
<xs:group name="fn.content">
<xs:choice>
<xs:group ref="Content-expr.class"/>
<!--<xs:group ref="Presentation-expr.class"/>-->
</xs:choice>
</xs:group>
(this is in file content/constructs.xsd at line 43), then the validation will work.

For more information about the error you can look at:
http://www.w3.org/TR/2001/REC-xmlschema ... s-nonambig
and
http://www.w3.org/TR/2001/REC-xmlschema ... #non-ambig

Basically the problem is if a processor finds the cn element and the model is:

Code: Select all


<xs:choice> 
<xs:group ref="Content-expr.class"/>
<xs:group ref="Presentation-expr.class"/>
</xs:choice>
then both choice alternatives can be followed. According with the UPA only one of the choice alternatives should accept cn.

Hope that helps,
George