Re: XML Schema language version

"C. M. Sperberg-McQueen" <[email protected]> Thu, 10 Oct 2013 18:12:54 -0600
Newsgroups gmane.text.xml.schema.devel
Message-ID <[email protected]>
On Oct 10, 2013, at 2:19 AM, George Cristian Bina wrote:

> Thanks Mike for this suggestion!
>=20
> We will implement this algorithm in oXygen:
>=20
> if (there are vc:minVersion or vc:maxVersion attributes on the schema =
root element) then {
> 	if (version 1.1 is accepted)
> 		then (use XML Schema version 1.1)
> 		else if (version 1.0 is accepted)
> 			then (use XML Schema version 1.0)
> 			else (throw unsupported schema version error)
> } else (use the default XML Schema version specified in oXygen =
options)

I wouldn't do it that way.  A specification of vc:minVersion says that
1.0 is the lowest version number required to process the element in
question and its descendants; that's true for a 1.0 schema document=20
but not, in general, for a 1.1 schema schema document.

In other words, vc:minVersion=3D"1.0" allows a 1.1 processor to handle
the document, but it doesn't forbid a 1.0 processor from handling it.  =
So
it implicitly suggests that the schema document so marked is a 1.0
document, not a 1.1 document.

If a schema author wants to ensure that ONLY a 1.0 processor will
handle the schema, they can use maxVersion=3Dn, for any n greater than
1.0.
 =20
> It is unfortunate that, as Andreas mentioned, the maxVersion is =
exclusive.

In a schema document that provides several versions of a=20
declaration, the goal is to provide semantics for the vc:* attributes
that allow a schema author to be sure that every processor will
find exactly one declaration:

  <xs:element name=3D"E" type=3D"Te-1.0"=20
    vc:minVersion=3D"1.0" vc:maxVersion=3D"1.1"/>
  <xs:element name=3D"E" type=3D"Te-1.1"=20
    vc:minVersion=3D"1.1" vc:maxVersion=3D"1.2"/>
  <xs:element name=3D"E" type=3D"Te-1.2"=20
    vc:minVersion=3D"1.2" vc:maxVersion=3D"1.21"/>
  <xs:element name=3D"E" type=3D"Te-2.0"=20
    vc:minVersion=3D"1.21" vc:maxVersion=3D"2.0"/>
  <xs:element name=3D"E" type=3D"Te-1.2"=20
    vc:minVersion=3D"2.0"/>

This ensures that a processor which has support for any version
whose number is 1.0 or higher will find exactly one declaration
to read.

> ...
>=20
> and as you can see people will easily get confused about the =
maxVersion=3D"1.1" in the XML Schema 1.0 documents.
> This also makes difficult to specify an XML Schema 1.1 only document, =
because what shall be used for maxVersion? 1.2, 2, 2.0, 1.1.1?

For a 1.1 document, I would not use maxVersion; I'd use =
minVersion=3D"1.1".

--=20
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com=20
* http://cmsmcq.com/mib                =20
* http://balisage.net
****************************************************************