XML Schema language version

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

XML Schema language version

George Cristian Bina-2
Hi all,

We introduced XML Schema 1.1 support in oXygen some time ago. As there
is no way to specify the version of the XML Schema language we added an
application option that controls what version is in use. By default XML
Schema 1.1 is selected and we show a notification to the user informing
him that we use XML Schema 1.1 with two options:
  Continue with 1.1
  Switch back to 1.0
After the user chooses one of these options this notification disappears
and is not presented again, the user being able to change the XML Schema
version from the oXygen preferences and even specify a specific value
for each project.

One problem we encountered with a number of users is that they choose to
continue with XML Schema 1.1 and then they forget about this. They
develop XML Schema 1.1 schemas and deploy them to users using XML Schema
1.0 tools, without being aware that they are using XML Schema 1.1
features in their schemas.

Not having a mechanism of setting the XML Schmea language version inside
the schema file makes difficult working with XML Schema 1.0 and XML
Schema 1.1 files in the same time.

We can add of course an oXygen specific way of specifying the XML Schema
language version required to process a specific XML Schema in the form
of a PI or an annotation but it will be useful to see if there is more
interest in having this functionality and then find a better way to
specify and implement this so that people can use the same syntax and
have that understood by more tools. Maybe a W3C Note will be a good
choice for specifying this, similar to the xml-model PI for associating
a schema with a document.

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

C. M. Sperberg-McQueen-2

On Sep 26, 2013, at 2:58 AM, George Cristian Bina wrote:

> Hi all,
>
> We introduced XML Schema 1.1 support in oXygen some time ago. As there is no way to specify the version of the XML Schema language we added an application option that controls what version is in use. By default XML Schema 1.1 is selected and we show a notification to the user informing him that we use XML Schema 1.1 with two options:
> Continue with 1.1
> Switch back to 1.0
> After the user chooses one of these options this notification disappears and is not presented again, the user being able to change the XML Schema version from the oXygen preferences and even specify a specific value for each project.
>
> One problem we encountered with a number of users is that they choose to continue with XML Schema 1.1 and then they forget about this. They develop XML Schema 1.1 schemas and deploy them to users using XML Schema 1.0 tools, without being aware that they are using XML Schema 1.1 features in their schemas.
>
> Not having a mechanism of setting the XML Schmea language version inside the schema file makes difficult working with XML Schema 1.0 and XML Schema 1.1 files in the same time.
>
> We can add of course an oXygen specific way of specifying the XML Schema language version required to process a specific XML Schema in the form of a PI or an annotation but it will be useful to see if there is more interest in having this functionality and then find a better way to specify and implement this so that people can use the same syntax and have that understood by more tools. Maybe a W3C Note will be a good choice for specifying this, similar to the xml-model PI for associating a schema with a document.

It certainly seems that the two decisions (a) not to put any version identifier
into an XSD 1.0 schema, and (b) not to change the namespace in XSD 1.1,
working together, were a mistake.

I believe the URIs specified in XSD 1.1 for denoting specific versions of
XSD should be useful here -- at least, they provide a standard way to say
things like "XSD 1.0" and "XSD 1.1".


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





Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

Michael Kay
I think it would be a creative but perfectly reasonable interpretation of the XSD 1.1 specification to advise users to set vc:minVersion="1.0" or vc:minVersion="1.1" or vc:maxVersion="1.0" on the xs:schema element to indicate whether they expect to use a 1.0 processor or a 1.1 processor for the schema, and for an IDE such as oXygen to use this attribute when selecting a processor to run.

See http://www.w3.org/TR/xmlschema11-1/#cip

Michael Kay
Saxonica

On 2 Oct 2013, at 20:55, C. M. Sperberg-McQueen wrote:

>
> On Sep 26, 2013, at 2:58 AM, George Cristian Bina wrote:
>
>> Hi all,
>>
>> We introduced XML Schema 1.1 support in oXygen some time ago. As there is no way to specify the version of the XML Schema language we added an application option that controls what version is in use. By default XML Schema 1.1 is selected and we show a notification to the user informing him that we use XML Schema 1.1 with two options:
>> Continue with 1.1
>> Switch back to 1.0
>> After the user chooses one of these options this notification disappears and is not presented again, the user being able to change the XML Schema version from the oXygen preferences and even specify a specific value for each project.
>>
>> One problem we encountered with a number of users is that they choose to continue with XML Schema 1.1 and then they forget about this. They develop XML Schema 1.1 schemas and deploy them to users using XML Schema 1.0 tools, without being aware that they are using XML Schema 1.1 features in their schemas.
>>
>> Not having a mechanism of setting the XML Schmea language version inside the schema file makes difficult working with XML Schema 1.0 and XML Schema 1.1 files in the same time.
>>
>> We can add of course an oXygen specific way of specifying the XML Schema language version required to process a specific XML Schema in the form of a PI or an annotation but it will be useful to see if there is more interest in having this functionality and then find a better way to specify and implement this so that people can use the same syntax and have that understood by more tools. Maybe a W3C Note will be a good choice for specifying this, similar to the xml-model PI for associating a schema with a document.
>
> It certainly seems that the two decisions (a) not to put any version identifier
> into an XSD 1.0 schema, and (b) not to change the namespace in XSD 1.1,
> working together, were a mistake.
>
> I believe the URIs specified in XSD 1.1 for denoting specific versions of
> XSD should be useful here -- at least, they provide a standard way to say
> things like "XSD 1.0" and "XSD 1.1".
>
>
> --
> ****************************************************************
> * C. M. Sperberg-McQueen, Black Mesa Technologies LLC
> * http://www.blackmesatech.com 
> * http://cmsmcq.com/mib                 
> * http://balisage.net
> ****************************************************************
>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

C. M. Sperberg-McQueen-2

On Oct 2, 2013, at 2:12 PM, Michael Kay wrote:

> I think it would be a creative but perfectly reasonable interpretation of the XSD 1.1 specification to advise users to set vc:minVersion="1.0" or vc:minVersion="1.1" or vc:maxVersion="1.0" on the xs:schema element to indicate whether they expect to use a 1.0 processor or a 1.1 processor for the schema, and for an IDE such as oXygen to use this attribute when selecting a processor to run.
>
> See http://www.w3.org/TR/xmlschema11-1/#cip


That's an elegant idea, much better than the vague notions that were
floating around in my mind's eye of using the xml-model PI with
a new pseudo-attribute like

  version="http://www.w3.org/XML/XMLSchema/v1.0"

or

  version="http://www.w3.org/XML/XMLSchema/v1.1"

I think vc:minVersion and vc:maxVersion are nicer.

To be specific, I think

  vc:minVersion="1.0" should be taken to mean a 1.0 or a 1.1
  processor is fine for validations using this schema, but an
  editor like Oxygen should check that the schema document
  uses only 1.0 features, or that any 1.1 features are protected
  by an appropriate version-control attribute, like
  vc:minVersion="1.1".

  vc:maxVersion="1.0" should mean that ONLY a 1.0
  validator should be used for validation, and that no 1.1
  features should be included at all (even with a
  version-control attribute).

  vc:minVersion="1.1" should mean that a 1.1 (or higher, if
  that day were ever to come) processor should be used for
  validation, and that an editor should check that only 1.1
  features are used.

Michael

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





Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

Timothy W. Cook-2
In reply to this post by Michael Kay
vc:minVersion="1.1" is a great solution for marking them as 1.1 required. Is there a need for a vc:maxVersion?

--Tim 


On Wed, Oct 2, 2013 at 5:12 PM, Michael Kay <[hidden email]> wrote:
I think it would be a creative but perfectly reasonable interpretation of the XSD 1.1 specification to advise users to set vc:minVersion="1.0" or vc:minVersion="1.1" or vc:maxVersion="1.0" on the xs:schema element to indicate whether they expect to use a 1.0 processor or a 1.1 processor for the schema, and for an IDE such as oXygen to use this attribute when selecting a processor to run.

See http://www.w3.org/TR/xmlschema11-1/#cip

Michael Kay
Saxonica

On 2 Oct 2013, at 20:55, C. M. Sperberg-McQueen wrote:

>
> On Sep 26, 2013, at 2:58 AM, George Cristian Bina wrote:
>
>> Hi all,
>>
>> We introduced XML Schema 1.1 support in oXygen some time ago. As there is no way to specify the version of the XML Schema language we added an application option that controls what version is in use. By default XML Schema 1.1 is selected and we show a notification to the user informing him that we use XML Schema 1.1 with two options:
>> Continue with 1.1
>> Switch back to 1.0
>> After the user chooses one of these options this notification disappears and is not presented again, the user being able to change the XML Schema version from the oXygen preferences and even specify a specific value for each project.
>>
>> One problem we encountered with a number of users is that they choose to continue with XML Schema 1.1 and then they forget about this. They develop XML Schema 1.1 schemas and deploy them to users using XML Schema 1.0 tools, without being aware that they are using XML Schema 1.1 features in their schemas.
>>
>> Not having a mechanism of setting the XML Schmea language version inside the schema file makes difficult working with XML Schema 1.0 and XML Schema 1.1 files in the same time.
>>
>> We can add of course an oXygen specific way of specifying the XML Schema language version required to process a specific XML Schema in the form of a PI or an annotation but it will be useful to see if there is more interest in having this functionality and then find a better way to specify and implement this so that people can use the same syntax and have that understood by more tools. Maybe a W3C Note will be a good choice for specifying this, similar to the xml-model PI for associating a schema with a document.
>
> It certainly seems that the two decisions (a) not to put any version identifier
> into an XSD 1.0 schema, and (b) not to change the namespace in XSD 1.1,
> working together, were a mistake.
>
> I believe the URIs specified in XSD 1.1 for denoting specific versions of
> XSD should be useful here -- at least, they provide a standard way to say
> things like "XSD 1.0" and "XSD 1.1".
>
>
> --
> ****************************************************************
> * C. M. Sperberg-McQueen, Black Mesa Technologies LLC
> * http://www.blackmesatech.com
> * http://cmsmcq.com/mib
> * http://balisage.net
> ****************************************************************
>
>
>
>
>





--
MLHIM VIP Signup: http://goo.gl/22B0U
============================================
Timothy Cook, MSc           +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

C. M. Sperberg-McQueen-2

On Oct 2, 2013, at 5:22 PM, Timothy W. Cook wrote:

> vc:minVersion="1.1" is a great solution for marking them as 1.1 required. Is there a need for a vc:maxVersion?

Probably less of a need, if (as I suggested in another mail)
vc:minVersion="1.0" is taken by editing environments as a
hint that the schema author wants to limit the schema document
to 1.0 constructs.

But since the 1.1 spec already defines both minVersion and
maxVersion, and since both have plausible interpretations,
I hope that any software that uses these attributes on the
schema document in the suggested way will be prepared to
handle both attributes.

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





Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

Timothy W. Cook-2
On Wed, Oct 2, 2013 at 9:47 PM, C. M. Sperberg-McQueen <[hidden email]> wrote:

But since the 1.1 spec already defines both minVersion and
maxVersion, and since both have plausible interpretations,
I hope that any software that uses these attributes on the
schema document in the suggested way will be prepared to
handle both attributes.


+1 



--
MLHIM VIP Signup: http://goo.gl/22B0U
============================================
Timothy Cook, MSc           +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

XML Dev
In reply to this post by George Cristian Bina-2
Hi,

I just want to mention that vc:maxVersion="1.1" would lead to an empty schema document for a 1.1 processor (see http://www.w3.org/TR/xmlschema11-1/#cip) :

"If V is less than the value of vc:minVersion, or if V is greater than or equal to the value of vc:maxVersion, then the element on which the attribute appears is to be ignored, along with all its attributes and descendants. The effect is that portions of the schema document marked with vc:minVersion and/or vc:maxVersion are retained if vc:minVersion ≤ V < vc:maxVersion."

So if vc:maxVersion is used as hint for the schema version a value of "1.1" should mean: validate in schema 1.0 mode.

Best regards,

Andreas Meissl
Software Engineer
Altova GmbH
www.altova.com

This e-mail and any attachments are intended only for the person/entity to which they are addressed and may contain confidential and/or privileged material. If you received this in error, please notify the sender and delete the message.
Altova GmbH, Firmenbuch: FN 206295 a, Sitz: Wien, DVR: 4010384, Handelsgericht: Wien, Rechtsform: Ges.m.b.H., UID: ATU66731218.



Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

C. M. Sperberg-McQueen-2

On Oct 3, 2013, at 3:34 AM, XML Dev wrote:

> Hi,
>
> I just want to mention that vc:maxVersion="1.1" would lead to an empty schema document for a 1.1 processor (see http://www.w3.org/TR/xmlschema11-1/#cip) :
>
> "If V is less than the value of vc:minVersion, or if V is greater than or equal to the value of vc:maxVersion, then the element on which the attribute appears is to be ignored, along with all its attributes and descendants. The effect is that portions of the schema document marked with vc:minVersion and/or vc:maxVersion are retained if vc:minVersion ≤ V < vc:maxVersion."
>
> So if vc:maxVersion is used as hint for the schema version a value of "1.1" should mean: validate in schema 1.0 mode.

Good catch.

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





Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

Loren Cahlander
The document at http://www.w3.org/2007/XMLSchema-versioning/ needs to be updated.  There are typos, "How it workds."  The example in that section is wrong.

The example in http://www.w3.org/TR/xmlschema11-1/#cip is much better.


Sent from my iPad

On Oct 3, 2013, at 10:00 AM, "C. M. Sperberg-McQueen" <[hidden email]> wrote:


On Oct 3, 2013, at 3:34 AM, XML Dev wrote:

Hi,

I just want to mention that vc:maxVersion="1.1" would lead to an empty schema document for a 1.1 processor (see http://www.w3.org/TR/xmlschema11-1/#cip) :

"If V is less than the value of vc:minVersion, or if V is greater than or equal to the value of vc:maxVersion, then the element on which the attribute appears is to be ignored, along with all its attributes and descendants. The effect is that portions of the schema document marked with vc:minVersion and/or vc:maxVersion are retained if vc:minVersion ≤ V < vc:maxVersion."

So if vc:maxVersion is used as hint for the schema version a value of "1.1" should mean: validate in schema 1.0 mode.

Good catch.

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





Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

George Cristian Bina-2
In reply to this post by Michael Kay
Thanks Mike for this suggestion!

We will implement this algorithm in oXygen:

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)

It is unfortunate that, as Andreas mentioned, the maxVersion is
exclusive. For example, if we will add new document templates to allow
users to easily create XML Schema 1.0 and XML Schema 1.1 document by
setting the vc:* attributes the templates will look like this:

for XML Schema 1.0:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
   vc:maxVersion="1.1"
   elementFormDefault="qualified">

</xs:schema>

for XML Schema 1.1

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
   vc:minVersion="1.1"
   elementFormDefault="qualified">

</xs:schema>

and as you can see people will easily get confused about the
maxVersion="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?

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 10/2/13 11:12 PM, Michael Kay wrote:

> I think it would be a creative but perfectly reasonable interpretation of the XSD 1.1 specification to advise users to set vc:minVersion="1.0" or vc:minVersion="1.1" or vc:maxVersion="1.0" on the xs:schema element to indicate whether they expect to use a 1.0 processor or a 1.1 processor for the schema, and for an IDE such as oXygen to use this attribute when selecting a processor to run.
>
> See http://www.w3.org/TR/xmlschema11-1/#cip
>
> Michael Kay
> Saxonica
>
> On 2 Oct 2013, at 20:55, C. M. Sperberg-McQueen wrote:
>
>>
>> On Sep 26, 2013, at 2:58 AM, George Cristian Bina wrote:
>>
>>> Hi all,
>>>
>>> We introduced XML Schema 1.1 support in oXygen some time ago. As there is no way to specify the version of the XML Schema language we added an application option that controls what version is in use. By default XML Schema 1.1 is selected and we show a notification to the user informing him that we use XML Schema 1.1 with two options:
>>> Continue with 1.1
>>> Switch back to 1.0
>>> After the user chooses one of these options this notification disappears and is not presented again, the user being able to change the XML Schema version from the oXygen preferences and even specify a specific value for each project.
>>>
>>> One problem we encountered with a number of users is that they choose to continue with XML Schema 1.1 and then they forget about this. They develop XML Schema 1.1 schemas and deploy them to users using XML Schema 1.0 tools, without being aware that they are using XML Schema 1.1 features in their schemas.
>>>
>>> Not having a mechanism of setting the XML Schmea language version inside the schema file makes difficult working with XML Schema 1.0 and XML Schema 1.1 files in the same time.
>>>
>>> We can add of course an oXygen specific way of specifying the XML Schema language version required to process a specific XML Schema in the form of a PI or an annotation but it will be useful to see if there is more interest in having this functionality and then find a better way to specify and implement this so that people can use the same syntax and have that understood by more tools. Maybe a W3C Note will be a good choice for specifying this, similar to the xml-model PI for associating a schema with a document.
>>
>> It certainly seems that the two decisions (a) not to put any version identifier
>> into an XSD 1.0 schema, and (b) not to change the namespace in XSD 1.1,
>> working together, were a mistake.
>>
>> I believe the URIs specified in XSD 1.1 for denoting specific versions of
>> XSD should be useful here -- at least, they provide a standard way to say
>> things like "XSD 1.0" and "XSD 1.1".
>>
>>
>> --
>> ****************************************************************
>> * C. M. Sperberg-McQueen, Black Mesa Technologies LLC
>> * http://www.blackmesatech.com
>> * http://cmsmcq.com/mib
>> * http://balisage.net
>> ****************************************************************
>>
>>
>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

Michael Kay
Yes, the exclusive nature is a bit of a pain. I would use values like max=1.0001 or max=1.1001.

Michael Kay
Saxonica

On 10 Oct 2013, at 09:19, George Cristian Bina wrote:

> Thanks Mike for this suggestion!
>
> We will implement this algorithm in oXygen:
>
> 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)
>
> It is unfortunate that, as Andreas mentioned, the maxVersion is exclusive. For example, if we will add new document templates to allow users to easily create XML Schema 1.0 and XML Schema 1.1 document by setting the vc:* attributes the templates will look like this:
>
> for XML Schema 1.0:
>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>  xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
>  vc:maxVersion="1.1"
>  elementFormDefault="qualified">
>
> </xs:schema>
>
> for XML Schema 1.1
>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>  xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
>  vc:minVersion="1.1"
>  elementFormDefault="qualified">
>
> </xs:schema>
>
> and as you can see people will easily get confused about the maxVersion="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?
>
> Best Regards,
> George
> --
> George Cristian Bina
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> http://www.oxygenxml.com
>
> On 10/2/13 11:12 PM, Michael Kay wrote:
>> I think it would be a creative but perfectly reasonable interpretation of the XSD 1.1 specification to advise users to set vc:minVersion="1.0" or vc:minVersion="1.1" or vc:maxVersion="1.0" on the xs:schema element to indicate whether they expect to use a 1.0 processor or a 1.1 processor for the schema, and for an IDE such as oXygen to use this attribute when selecting a processor to run.
>>
>> See http://www.w3.org/TR/xmlschema11-1/#cip
>>
>> Michael Kay
>> Saxonica
>>
>> On 2 Oct 2013, at 20:55, C. M. Sperberg-McQueen wrote:
>>
>>>
>>> On Sep 26, 2013, at 2:58 AM, George Cristian Bina wrote:
>>>
>>>> Hi all,
>>>>
>>>> We introduced XML Schema 1.1 support in oXygen some time ago. As there is no way to specify the version of the XML Schema language we added an application option that controls what version is in use. By default XML Schema 1.1 is selected and we show a notification to the user informing him that we use XML Schema 1.1 with two options:
>>>> Continue with 1.1
>>>> Switch back to 1.0
>>>> After the user chooses one of these options this notification disappears and is not presented again, the user being able to change the XML Schema version from the oXygen preferences and even specify a specific value for each project.
>>>>
>>>> One problem we encountered with a number of users is that they choose to continue with XML Schema 1.1 and then they forget about this. They develop XML Schema 1.1 schemas and deploy them to users using XML Schema 1.0 tools, without being aware that they are using XML Schema 1.1 features in their schemas.
>>>>
>>>> Not having a mechanism of setting the XML Schmea language version inside the schema file makes difficult working with XML Schema 1.0 and XML Schema 1.1 files in the same time.
>>>>
>>>> We can add of course an oXygen specific way of specifying the XML Schema language version required to process a specific XML Schema in the form of a PI or an annotation but it will be useful to see if there is more interest in having this functionality and then find a better way to specify and implement this so that people can use the same syntax and have that understood by more tools. Maybe a W3C Note will be a good choice for specifying this, similar to the xml-model PI for associating a schema with a document.
>>>
>>> It certainly seems that the two decisions (a) not to put any version identifier
>>> into an XSD 1.0 schema, and (b) not to change the namespace in XSD 1.1,
>>> working together, were a mistake.
>>>
>>> I believe the URIs specified in XSD 1.1 for denoting specific versions of
>>> XSD should be useful here -- at least, they provide a standard way to say
>>> things like "XSD 1.0" and "XSD 1.1".
>>>
>>>
>>> --
>>> ****************************************************************
>>> * C. M. Sperberg-McQueen, Black Mesa Technologies LLC
>>> * http://www.blackmesatech.com
>>> * http://cmsmcq.com/mib
>>> * http://balisage.net
>>> ****************************************************************
>>>
>>>
>>>
>>>
>>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

Timothy W. Cook-2
In reply to this post by George Cristian Bina-2
Thanks for this addition to oXygen. 
The maxVersion issue needs to be fixed in the specs.  I think everyone agrees that the current definition is just non-sensical. 



On Thu, Oct 10, 2013 at 5:19 AM, George Cristian Bina <[hidden email]> wrote:
Thanks Mike for this suggestion!

We will implement this algorithm in oXygen:

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)

It is unfortunate that, as Andreas mentioned, the maxVersion is exclusive. For example, if we will add new document templates to allow users to easily create XML Schema 1.0 and XML Schema 1.1 document by setting the vc:* attributes the templates will look like this:

for XML Schema 1.0:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
  vc:maxVersion="1.1"
  elementFormDefault="qualified">

</xs:schema>

for XML Schema 1.1

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
  vc:minVersion="1.1"
  elementFormDefault="qualified">

</xs:schema>

and as you can see people will easily get confused about the maxVersion="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?


Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 10/2/13 11:12 PM, Michael Kay wrote:
I think it would be a creative but perfectly reasonable interpretation of the XSD 1.1 specification to advise users to set vc:minVersion="1.0" or vc:minVersion="1.1" or vc:maxVersion="1.0" on the xs:schema element to indicate whether they expect to use a 1.0 processor or a 1.1 processor for the schema, and for an IDE such as oXygen to use this attribute when selecting a processor to run.

See http://www.w3.org/TR/xmlschema11-1/#cip

Michael Kay
Saxonica

On 2 Oct 2013, at 20:55, C. M. Sperberg-McQueen wrote:


On Sep 26, 2013, at 2:58 AM, George Cristian Bina wrote:

Hi all,

We introduced XML Schema 1.1 support in oXygen some time ago. As there is no way to specify the version of the XML Schema language we added an application option that controls what version is in use. By default XML Schema 1.1 is selected and we show a notification to the user informing him that we use XML Schema 1.1 with two options:
Continue with 1.1
Switch back to 1.0
After the user chooses one of these options this notification disappears and is not presented again, the user being able to change the XML Schema version from the oXygen preferences and even specify a specific value for each project.

One problem we encountered with a number of users is that they choose to continue with XML Schema 1.1 and then they forget about this. They develop XML Schema 1.1 schemas and deploy them to users using XML Schema 1.0 tools, without being aware that they are using XML Schema 1.1 features in their schemas.

Not having a mechanism of setting the XML Schmea language version inside the schema file makes difficult working with XML Schema 1.0 and XML Schema 1.1 files in the same time.

We can add of course an oXygen specific way of specifying the XML Schema language version required to process a specific XML Schema in the form of a PI or an annotation but it will be useful to see if there is more interest in having this functionality and then find a better way to specify and implement this so that people can use the same syntax and have that understood by more tools. Maybe a W3C Note will be a good choice for specifying this, similar to the xml-model PI for associating a schema with a document.

It certainly seems that the two decisions (a) not to put any version identifier
into an XSD 1.0 schema, and (b) not to change the namespace in XSD 1.1,
working together, were a mistake.

I believe the URIs specified in XSD 1.1 for denoting specific versions of
XSD should be useful here -- at least, they provide a standard way to say
things like "XSD 1.0" and "XSD 1.1".


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










--
MLHIM VIP Signup: http://goo.gl/22B0U
============================================
Timothy Cook, MSc           +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

Loren Cahlander
I fully agree.  Max means less than or equal, not less than.

The example in http://www.w3.org/2007/XMLSchema-versioning/ matches the general understaning of max.  The second value in the example should have been min and not max.

Schema authors can use this to provide alternative formulations of some constructs, using idioms like the following:

<schema ... 
   xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning">

  <complexType name="T" vc:maxVersion="1.1">
    ... definition for version 1.0 and 1.1 processors  ...
  </complexType>
  <complexType name="T" vc:maxVersion="1.2">
    ...  definition for 1.2 and later processors  ... 
  </complexType>

</schema>

Should be:

Schema authors can use this to provide alternative formulations of some constructs, using idioms like the following:

<schema ... 
   xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning">

  <complexType name="T" vc:maxVersion="1.1">
    ... definition for version 1.0 and 1.1 processors  ...
  </complexType>
  <complexType name="T" vc:minVersion="1.2">
    ...  definition for 1.2 and later processors  ... 
  </complexType>

</schema>


On Oct 10, 2013, at 6:35 AM, "Timothy W. Cook" <[hidden email]> wrote:

Thanks for this addition to oXygen. 
The maxVersion issue needs to be fixed in the specs.  I think everyone agrees that the current definition is just non-sensical. 



On Thu, Oct 10, 2013 at 5:19 AM, George Cristian Bina <[hidden email]> wrote:
Thanks Mike for this suggestion!

We will implement this algorithm in oXygen:

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)

It is unfortunate that, as Andreas mentioned, the maxVersion is exclusive. For example, if we will add new document templates to allow users to easily create XML Schema 1.0 and XML Schema 1.1 document by setting the vc:* attributes the templates will look like this:

for XML Schema 1.0:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
  vc:maxVersion="1.1"
  elementFormDefault="qualified">

</xs:schema>

for XML Schema 1.1

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
  vc:minVersion="1.1"
  elementFormDefault="qualified">

</xs:schema>

and as you can see people will easily get confused about the maxVersion="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?


Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 10/2/13 11:12 PM, Michael Kay wrote:
I think it would be a creative but perfectly reasonable interpretation of the XSD 1.1 specification to advise users to set vc:minVersion="1.0" or vc:minVersion="1.1" or vc:maxVersion="1.0" on the xs:schema element to indicate whether they expect to use a 1.0 processor or a 1.1 processor for the schema, and for an IDE such as oXygen to use this attribute when selecting a processor to run.

See http://www.w3.org/TR/xmlschema11-1/#cip

Michael Kay
Saxonica

On 2 Oct 2013, at 20:55, C. M. Sperberg-McQueen wrote:


On Sep 26, 2013, at 2:58 AM, George Cristian Bina wrote:

Hi all,

We introduced XML Schema 1.1 support in oXygen some time ago. As there is no way to specify the version of the XML Schema language we added an application option that controls what version is in use. By default XML Schema 1.1 is selected and we show a notification to the user informing him that we use XML Schema 1.1 with two options:
Continue with 1.1
Switch back to 1.0
After the user chooses one of these options this notification disappears and is not presented again, the user being able to change the XML Schema version from the oXygen preferences and even specify a specific value for each project.

One problem we encountered with a number of users is that they choose to continue with XML Schema 1.1 and then they forget about this. They develop XML Schema 1.1 schemas and deploy them to users using XML Schema 1.0 tools, without being aware that they are using XML Schema 1.1 features in their schemas.

Not having a mechanism of setting the XML Schmea language version inside the schema file makes difficult working with XML Schema 1.0 and XML Schema 1.1 files in the same time.

We can add of course an oXygen specific way of specifying the XML Schema language version required to process a specific XML Schema in the form of a PI or an annotation but it will be useful to see if there is more interest in having this functionality and then find a better way to specify and implement this so that people can use the same syntax and have that understood by more tools. Maybe a W3C Note will be a good choice for specifying this, similar to the xml-model PI for associating a schema with a document.

It certainly seems that the two decisions (a) not to put any version identifier
into an XSD 1.0 schema, and (b) not to change the namespace in XSD 1.1,
working together, were a mistake.

I believe the URIs specified in XSD 1.1 for denoting specific versions of
XSD should be useful here -- at least, they provide a standard way to say
things like "XSD 1.0" and "XSD 1.1".


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










--
MLHIM VIP Signup: http://goo.gl/22B0U
============================================
Timothy Cook, MSc           +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

C. M. Sperberg-McQueen-2
In reply to this post by George Cristian Bina-2

On Oct 10, 2013, at 2:19 AM, George Cristian Bina wrote:

> Thanks Mike for this suggestion!
>
> We will implement this algorithm in oXygen:
>
> 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
but not, in general, for a 1.1 schema schema document.

In other words, vc:minVersion="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=n, for any n greater than
1.0.
 
> It is unfortunate that, as Andreas mentioned, the maxVersion is exclusive.

In a schema document that provides several versions of a
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="E" type="Te-1.0"
    vc:minVersion="1.0" vc:maxVersion="1.1"/>
  <xs:element name="E" type="Te-1.1"
    vc:minVersion="1.1" vc:maxVersion="1.2"/>
  <xs:element name="E" type="Te-1.2"
    vc:minVersion="1.2" vc:maxVersion="1.21"/>
  <xs:element name="E" type="Te-2.0"
    vc:minVersion="1.21" vc:maxVersion="2.0"/>
  <xs:element name="E" type="Te-1.2"
    vc:minVersion="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.

> ...
>
> and as you can see people will easily get confused about the maxVersion="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="1.1".

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





Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

C. M. Sperberg-McQueen-2
In reply to this post by Timothy W. Cook-2

On Oct 10, 2013, at 4:35 AM, Timothy W. Cook wrote:

> Thanks for this addition to oXygen.
> The maxVersion issue needs to be fixed in the specs.  I think everyone agrees that the current definition is just non-sensical.

Well, no.

The initial draft of the vc:* namespace had inclusive semantics for
both minVersion and maxVersion, and the WG received a strong
objection from another WG which wanted a way to ensure that
all possible decimal version numbers were covered exactly once.

It's not at all nonsensical, and not particularly hard to work with.

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





Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

C. M. Sperberg-McQueen-2
In reply to this post by Loren Cahlander

On Oct 10, 2013, at 5:49 AM, Loren Cahlander wrote:

> I fully agree.  Max means less than or equal, not less than.
>
> The example in http://www.w3.org/2007/XMLSchema-versioning/ matches the general understaning of max.  

It also matches the initial description of the vc:* namespace, but not the final one.

> The second value in the example should have been min and not max.

The way to write this to get the behavior described is:

<schema ... xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning">

  <complexType name="T"  vc:maxVersion="1.2" >
    ... definition for version 1.0 and 1.1 processors ...
  </complexType>
  <complexType name="T" vc:minVersion="1.2" >
    ... definition for 1.2 and later processors ...
  </complexType>

</schema>


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





Reply | Threaded
Open this post in threaded view
|

Re: XML Schema language version

George Cristian Bina-2
In reply to this post by C. M. Sperberg-McQueen-2
Dear Michael,

If the document specifies only vc:minVersion="1.0" on the schema root
element then we will need to use an XML Schema 1.1 processor and this
matches the result of the provided algorithm.

Why we need to use an XML Schema 1.1 processor in this case?

minVersion="1.0" allows XML Schema 1.1 constructs but in the same time
it says that the schema is also a valid XML Schema 1.0. Now, because it
does not limit the schema to XML Schema 1.0 only, that will mean that
the 1.1 constructs are separately profiled, probably with a
vc:minVersion="1.1", thus they get excluded when the schema is processed
for an 1.0 processor. We need to use an XML Schema 1.1 processor because:
  - we need to provide the editing support for changing the schema and
the schema may contain 1.1 specific code, so we need to provide 1.1
content completion for example
  - Some XML Schema 1.0 processors may not support excluding content
based on the vc:* attributes so they will give errors on possible XML
Schema 1.1 constructs that are profiled to be excluded when the
processor version is 1.0
  - we want to provide the best support for users when they validate
their documents so we want to enforce additional 1.1 constraints
specified in the schema

Here it is a sample schema for which I would use a 1.1 processor and not
a 1.0 processor:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
   vc:minVersion="1.0"
   elementFormDefault="qualified">

   <xs:element name="root">
     <xs:complexType>
       <xs:sequence>
         <xs:element name="x" type="xs:string"/>
         <xs:element name="y" type="xs:string"/>
       </xs:sequence>
       <xs:assert vc:minVersion="1.1" test="string-length(x) +
string-length(y) > 10"/>
     </xs:complexType>
   </xs:element>
</xs:schema>

A few more comments:

 > If a schema author wants to ensure that ONLY a 1.0 processor will
 > handle the schema, they can use maxVersion=n, for any n greater than
 > 1.0.

That is not sufficient, n should be also less or equal to 1.1

 > In a schema document that provides several versions of a
 > 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="E" type="Te-1.0"
 >      vc:minVersion="1.0" vc:maxVersion="1.1"/>
 >    <xs:element name="E" type="Te-1.1"
 >      vc:minVersion="1.1" vc:maxVersion="1.2"/>
 >    <xs:element name="E" type="Te-1.2"
 >      vc:minVersion="1.2" vc:maxVersion="1.21"/>
 >    <xs:element name="E" type="Te-2.0"
 >      vc:minVersion="1.21" vc:maxVersion="2.0"/>
 >    <xs:element name="E" type="Te-1.2"
 >      vc:minVersion="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.

I am not sure I follow this.. Maybe you can specify in words what you
want to achieve and then I can see that this code fragment does that?
Now, looking at this I can see that, if v is the processor XML Schema
version then

for v in [1.0; 1.1)  the type of E is Te-1.0
for v in [1.1; 1.2)  the type of E is Te-1.1
for v in [1.2; 1.21) the type of E is Te-1.2
for v in [1.21; 2.0) the type of E is Te-2.0 ???
for v in [2.0; ∞) the type of E is Te-1.2 ???

I do not understand the logic of having Te-2.0 if the version is less
than 2.0 and Te-1.2 is the version is 2.0 or higher. I was thinking that
the name of the type hints to the schema version - thus my feedback to
explain in plain words what this code fragment tries to achieve.

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 10/11/13 3:12 AM, C. M. Sperberg-McQueen wrote:

>
> On Oct 10, 2013, at 2:19 AM, George Cristian Bina wrote:
>
>> Thanks Mike for this suggestion!
>>
>> We will implement this algorithm in oXygen:
>>
>> 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
> but not, in general, for a 1.1 schema schema document.
>
> In other words, vc:minVersion="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=n, for any n greater than
> 1.0.
>
>> It is unfortunate that, as Andreas mentioned, the maxVersion is exclusive.
>
> In a schema document that provides several versions of a
> 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="E" type="Te-1.0"
>      vc:minVersion="1.0" vc:maxVersion="1.1"/>
>    <xs:element name="E" type="Te-1.1"
>      vc:minVersion="1.1" vc:maxVersion="1.2"/>
>    <xs:element name="E" type="Te-1.2"
>      vc:minVersion="1.2" vc:maxVersion="1.21"/>
>    <xs:element name="E" type="Te-2.0"
>      vc:minVersion="1.21" vc:maxVersion="2.0"/>
>    <xs:element name="E" type="Te-1.2"
>      vc:minVersion="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.
>
>> ...
>>
>> and as you can see people will easily get confused about the maxVersion="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="1.1".
>