W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2012

Re: white space in xsd:hexBinary

From: Michael Kay <mike@saxonica.com>
Date: Mon, 16 Jan 2012 20:56:13 +0000
Message-ID: <4F148EED.3010602@saxonica.com>
To: www-xml-schema-comments@w3.org
 >Still if one could find out what the reasons might be, and if none 
were found to be that serious, one could perhaps have more lenient 
parsers get rid of those whitespaces in the context of RDF/XML.

The XSD 1.1 specification allows vendor-defined facets, and the Saxon 
engine has exploited this facility to define a facet saxon:preprocess 
that allows preprocessing of the value appearing in the instance 
document before validation starts (by means of an XPath expression). So 
you could define <saxon:preprocess action="translate($value, 
'&#10;&#32;', '')"/>. See

http://www.saxonica.com/documentation/schema-processing/extensions11/preprocess.xml

Technically this is a "pre-lexical" facet in that, like xs:whiteSpace, 
it defines processing that takes place before the lexical value is 
materialized. Other uses include allowing continental European number 
formats, or normalizing case prior to validation using an enumeration 
facet; it could also be used to permit the values "yes" and "no" for an 
xs:boolean.

Of course, a solution that only works in one processor is not very 
practical for most XSD users. But the experience with XSLT was that 
allowing vendors to make extensions of this kind stimulated other 
vendors to copy the more popular extensions, leading to the emergence of 
de-facto standard extensions which are then primary candidates for 
incorporation in a future version of the standard.

Michael Kay
Saxonica
Received on Monday, 16 January 2012 20:56:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 16 January 2012 20:56:39 GMT