Next in thread β†’ Next in month β†’

Re: [xml-dev] XML schema xs:string and non BMP character like 𐌀, length restriction

From
Martin Honnen <>
To
xml-dev <>
Date
2012-10-12T16:37:54Z
ID
<>
Thread
Re: [xml-dev] XML schema xs:string and non BMP character like &#x10300;, length restriction
Martin Honnen wrote:

> I am seeing inconsistencies between different schema validating parsers
> when it comes to Unicode characters outside of the BMP, like &#x10300;
> for instance, and length restrictions on xs:string.

> However Xerces Java 2.11 reports "[Error] oneCharInstance1.xml:3:25:
> cvc-length-valid: Value '?' with length = '2'
>   is not facet-valid with respect to length '1' for type 'one-char'." so
> it seems to consider the contents of the "test" element as a string with
> two characters.


Based on David's and Pete's agreement I went ahead and filed a bug 
https://issues.apache.org/jira/browse/XERCESJ-1592 on Xerces Java but it 
turned out the issue had been resolved weeks ago independent of this 
thread by "Introducing a system property for controlling how string 
length is computed by the schema validator. When 
org.apache.xerces.impl.dv.xs.useCodePointCountForStringLength=true, the 
length of an xs:string or xs:anyURI value is calculated by counting the 
number of Unicode code points in the string. The value of the system 
property is false by default, preserving the long standing behaviour of 
computing length in Java chars (i.e. String.length())."


-- 

	Martin Honnen --- MVP Data Platform Development
	http://msmvps.com/blogs/martin_honnen/
Next in thread β†’ Next in month β†’