[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Brain Teaser: Element Author is of type xsd:string, what's

  • From: noah_mendelsohn@u...
  • To: "Michael Kay" <mike@s...>
  • Date: Fri, 9 Feb 2007 10:47:47 -0500

RE:  Brain Teaser: Element Author is of type xsd:string
Michael Kay writes:


> There's a W3C note on handling XML 1.1 with XML Schema:
> 
> http://www.w3.org/TR/xml11schema10/
> 
> and it recommends (see the last line of the note) that with that
> combination, the definitions of the built-in types should be "stretched" 
to
> accommodate the characters allowed in XML 1.1. With that strategy, there
> will never be an invalid instance of xs:string.

Indeed.  That's about the best we could do without appearing to make a 
retoactive incompatible change to Schema 1.0.  With Schema 1.1, such 
incompatibilities are less of an issue.  Note that the latest public 
working draft of Schema 1.1 says [1]:

"[XML Schema: Datatypes] defines some datatypes which depend on 
definitions in [XML 1.1] and [XML-Namespaces 1.1]; those definitions, and 
therefore the datatypes based on them, vary between version 1.0 ([XML 
1.0], [XML-Namespaces 1.0]) and version 1.1 ([XML 1.1], [XML-Namespaces 
1.1]) of those specifications. In any given schema-validity-·assessment· 
episode, the choice of the 1.0 or the 1.1 definition of those datatypes is 
implementation-defined."

The working draft for Schema 1.1 Datatypes provides more details [2]:

"This specification defines some datatypes which depend on definitions in 
[XML] and [Namespaces in XML]; those definitions, and therefore the 
datatypes based on them, vary between version 1.0 ([XML 1.0], [Namespaces 
in XML 1.0]) and version 1.1 ([XML], [Namespaces in XML]) of those 
specifications. In any given use of this specification, the choice of the 
1.0 or the 1.1 definition of those datatypes is implementation-defined.

"Conforming implementations of this specification may provide either the 
1.1-based datatypes or the 1.0-based datatypes, or both. If both are 
supported, the choice of which datatypes to use in a particular assessment 
episode should be under user control.
Note:  When this specification is used to check the datatype validity of 
XML input, implementations may provide the heuristic of using the 1.1 
datatypes if the input is labeled as XML 1.1, and using the 1.0 datatypes 
if the input is labeled 1.0, but this heuristic should be subject to 
override by users, to support cases where users wish to accept XML 1.1 
input but validate it using the 1.0 datatypes, or accept XML 1.0 input and 
validate it using the 1.1 datatypes. "

Regarding "string" in particular, the Datatypes draft says [3]:

"It is implementation-defined whether an implementation of this 
specification supports the Char production from [XML], or that from [XML 
1.0], or both. See Dependencies on Other Specifications (§1.3)."

So I think we've been quite careful with the details there, and Schema 1.1 
can indeed be used to validate as strings the characters that Roger 
mentions.  Note that there are some characters that are not allowed in 
either XML 1.0 or XML 1.1 infosets, and thus are disallowed even in Schema 
1.1 strings.  I believe I'm correct that NUL (0x0) is one of these.

Noah

[1] http://www.w3.org/TR/xmlschema11-1/#intro1.1
[2] http://www.w3.org/TR/xmlschema11-2/#intro-relatedWork
[3] http://www.w3.org/TR/xmlschema11-2/#string
--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------






[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.