Talk:Schema Annexes

From OOXML-Wiki

Jump to: navigation, search

[edit] Schema files that don't validate

According to Xerces 2.9, there are problems with the following XML Schema files:

dml-chart.xsd, dml-chartDrawing.xsd, dml-diagramDataModel.xsd, dml-diagramDefinition.xsd, dml-diagramElementPropertySet.xsd, dml-diagramStyleDefinition.xsd, dml-picture.xsd, dml-spreadsheetDrawing.xsd, dml-wordprocessingDrawing.xsd, pml-animationInfo.xsd, pml-presentation.xsd, pml-slide.xsd, shared-math.xsd, vml-main.xsd, vml-officeDrawing.xsd, wml.xsd

The files from this list that I've checked so far have reported no errors in MSXML and XML Spy. Xerces, XSV and MSV do report errors.

For dml-chart.xsd, Xerces is having problems with:

<xsd:import namespace="http://schemas.openxmlformats.org/drawingml/2006/main" schemaLocation="dml-text.xsd" />  
<xsd:import namespace="http://schemas.openxmlformats.org/drawingml/2006/main" schemaLocation="dml-shapeProperties.xsd" />
<xsd:import namespace="http://schemas.openxmlformats.org/drawingml/2006/main" schemaLocation="dml-stylesheet.xsd" />

Xerces only recognizes the first import for a given namespace. This is arguably correct behaviour (see references below).

The XML Schema spec doesn't explicitly forbid using multiple import statements with the same namespace, but does imply that one schema URL per namespace is what's expected.

Noah Mendelsohn, co-author of the XML Schema recommendation, says:

"The schemaLocation on <import> is optional, and as you observe is a hint. It is NOT intended as a composition mechanism for multiple schema documents defining a single namespace."

http://xsd.stylusstudio.com/2002Sep/post07013.htm

Mike Kay, on the xsd list, says:

"The spec unfortunately is very vague on this. The schemaLocation is just a hint as to where to find a schema for a given namespace. If the system thinks it already has a schema for that namespace, it's entitled to assume that it's another copy of the same schema, and I think that's what Xerces is doing. It's best to assemble a complete schema for a namespace using xs:include, and then import the assembled schema."

http://xsd.stylusstudio.com/2004Aug/post09010.htm

Dare Obasanjo (then of Microsoft's schema validation dev team) reports:

"When last I looked we ignore multiple imports and pick only the first one for a given namespace."

http://xsd.stylusstudio.com/2002Sep/post06013.htm

[edit] Updated version of schemas

I've now altered my local version of the schemas to resolve the problems I've identified so far. They are all valid in Xerces, now. I haven't yet taken the time to validate all 88 of them in XSV and MSV, but the ones I've tested so far have been okay.

Personal tools