[Mono-list] Issues in XmlSchema.XmlSchemaElement

Tom Cabanski tcabanski@OAI.cc
Wed, 7 Jan 2004 07:37:51 -0600

You're not seeing my error because the compile gives up after the first
error because it throws an exception.  I found and fixed the whitespace
facet because I discovered it was clearly a problem with the schema and
a regex expression problem, which may or may not be a problem with the
schema (more research required).  This revealed the issue I posted.  (If
anyone cares, I can post the fixed schema or make it available for
download somewhere). =20

I'm 100% sure I won't be able to work around the ambiguous problem by
fixing the schema because of the goofy way the standard works (JDF that
is) and what goofy things they did in the schema to make it fit; it
impacts literally thousands of elements.  You see, the CIP4 folks didn't
have the XML schema standard when they started so they made some
decisions, like no ordering for child elements, that made it very hard
to build the schema in the first place.  Furthermore, they didn't want
to break backwards compatibility even in the early days so they couldn't
fix the standard to make it more compatible with how XML schema works.

Note that Microsoft and Xerces both compile and work with this schema
without difficulty.  XML Spy does too.  Very possibly, the Mono SOM is
doing a better job here.  Anyway, the schema is maintained by a CIP4
person based on decisions made in a small committee.  I'm going to
submit the various facet problems and I would expect them to fix those.
The ambiguity problem is going to be a lot tougher if it does turn out
to be real and not a bug in Mono.  Committee members will argue that if
it passes XML Spy, Xerces and Microsoft it should be good enough.

I'm in a bit of a bind because I have a customer willing to OEM my
toolkit if I can port it to Mono.  I'm going to start with some
improvements to the error handling so it doesn't stop on the first
problem.  That will at least make it easier to figure out what is going
on.  Incidentally, if I comment out the offending check in the
XmlSchemaElement, the schema does compile.  Who knows what that does to
the SOM and how it works later?  Anyway, I'll find that out as I move
forward today.

I'm running the IBM schema check tool now against the original JDF
schema as someone else suggested right now.=20

Tom Cabanski

-----Original Message-----
From: Atsushi Eno [mailto:atsushi@ximian.com]=20
Sent: Tuesday, January 06, 2004 10:35 PM
To: Tom Cabanski
Cc: mono-list@ximian.com
Subject: Re: [Mono-list] Issues in XmlSchema.XmlSchemaElement


> indicated, only getting other simple type compilation error (I haven't

> look into that detail).

In JDFTypes.xsd, there are such schema components:

<xs:simpleType name=3D"LabColor">
	<xs:restriction base=3D"jdftyp:NumberList">
		<xs:length value=3D"3" fixed=3D"true"/>
		<xs:whiteSpace value=3D"collapse"/>

<xs:simpleType name=3D"NumberList">
	<xs:list itemType=3D"jdftyp:number"/>

Here LabColor derives NumberList by restriction.
However, XML Schema structures 3.14.6 "Derivation Valid (Restriction,=20
Simple)" denotes:

   2 If the {variety} is list, then all of the following must be true:
     2.2 Only length, minLength, maxLength, pattern and enumeration
         facet components are allowed among the {facets}.

So here xs:whitespace facet is invalid.

MS.NET fails to reject this schema, if my speculation is correct.

Atsushi Eno