Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - whiteSpace facet [Thread Next] RE: whiteSpace facetTo: "Michael Kay" <mike@--------.--->, <xmlschema-dev@--.---> Date: 11/18/2007 12:54:00 PM Thanks. Shlomo. -----Original Message----- From: Michael Kay [mailto:mike@s...] Sent: Mon 11/19/2007 12:35 AM To: Shlomo Yona; xmlschema-dev@w... Subject: RE: whiteSpace facet See XML Schema Part 2 sectoin 4.3.6: whiteSpace is applicable to all <http://www.w3.org/TR/xmlschema-2/#dt-atomic> .atomic. and <http://www.w3.org/TR/xmlschema-2/#dt-list> .list. datatypes. For all <http://www.w3.org/TR/xmlschema-2/#dt-atomic> .atomic. datatypes other = than <http://www.w3.org/TR/xmlschema-2/#string> string (and types <http://www.w3.org/TR/xmlschema-2/#dt-derived> .derived. by <http://www.w3.org/TR/xmlschema-2/#dt-restriction> .restriction. from = it) the value of whiteSpace is collapse and cannot be changed by a schema author; for <http://www.w3.org/TR/xmlschema-2/#string> string the value = of whiteSpace is preserve; for any type <http://www.w3.org/TR/xmlschema-2/#dt-derived> .derived. by <http://www.w3.org/TR/xmlschema-2/#dt-restriction> .restriction. from <http://www.w3.org/TR/xmlschema-2/#string> string the value of = whiteSpace can be any of the three legal values. For all datatypes <http://www.w3.org/TR/xmlschema-2/#dt-derived> .derived. by <http://www.w3.org/TR/xmlschema-2/#dt-list> .list. the value of = whiteSpace is collapse and cannot be changed by a schema author. And the schema for schema documents: <xs:simpleType name="normalizedString" id="normalizedString"> <xs:annotation> <xs:documentation = source="http://www.w3.org/TR/xmlschema-2/#normalizedString"/> </xs:annotation> <xs:restriction base="xs:string"> <xs:whiteSpace value="replace" = id="normalizedString.whiteSpace"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="token" id="token"> <xs:annotation> <xs:documentation = source="http://www.w3.org/TR/xmlschema-2/#token"/> </xs:annotation> <xs:restriction base="xs:normalizedString"> <xs:whiteSpace value="collapse" id="token.whiteSpace"/> </xs:restriction> </xs:simpleType> Michael Kay http://www.saxonica.com/ _____ From: xmlschema-dev-request@w... [mailto:xmlschema-dev-request@w...] = On Behalf Of Shlomo Yona Sent: 18 November 2007 17:48 To: xmlschema-dev@w... Subject: whiteSpace facet Hello, My questions are regarding White Space Normalization during Validation http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#d0e165= 4. 1. Is there a "default" value for the whiteSpace facet for xsd:string, xsd:normalizedString and xsd:token? 2. What is the value of the whiteSpace facet for xsd:string? I assumed it was 'preserve'. Is it? 3. What is the value of the whiteSpace facet for xsd:normalizedString? I assumed it was 'replace'. Is it? 4. What is the value of the whiteSpace facet for xsd:token? I assumed it was 'collapse'. Is it? For example, if I have an element of type xsd:normalizedString and in = the XML instance the value of that element contains newline characters = should I: a. Expect an error/warning because the newline character is not in the lexical space of xsd:normalizedString? b. Expect the newline to be replaced with a space before validation proceeds? c. Something else? I'd go for "a" if the (implied?) "default" value for the whiteSpace = facet was "preserve". I'd go with "b" if the answer for question #3 was that the value is (or = is implied to be) "replace". But I just don't know. Can you please point to the relevant section(s) in the XML Schema 1.0 recommendation that supports your answer? Thank you. Shlomo. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
