Project

Profile

Help

9.8 xs:anyURI is less rigorous?

Added by T Hata over 7 years ago

'http://www.example.com/foo#bar#baz' castable as xs:anyURI

Replies (4)

Please register to reply

RE: 9.8 xs:anyURI is less rigorous? - Added by T Hata over 7 years ago

(I hit the submit button too early...)

Saxon 9.7.0.18J returns false for that kind of string. So I used it as a part of checks to see if I can invoke resolve-uri() etc.

Now 9.8.0.2J returns true. Is it a deliberate change?

RE: 9.8 xs:anyURI is less rigorous? - Added by Michael Kay over 7 years ago

In 9.8 we have changed the default XSD version from 1.0 to 1.1.

One of the differences between XSD 1.0 and 1.1 is that in 1.1, the xs:anyURI type essentially accepts any string. In XSD 1.0 the rules in the spec are a bit vague, but Saxon's interpretation is that the value is valid if either

(a) it is acceptable to java.net.URI(), or

(b) after percent-encoding using iri-to-uri(), it is acceptable to java.net.URI().

If you want the XSD 1.0 rules, you can either select XSD1.0 (for example using FeatureKeys.XSD_VERSION) in the Configuration, or you can customize it completely using Configuration.setConversionRules().

RE: 9.8 xs:anyURI is less rigorous? - Added by T Hata over 7 years ago

Thanks. Specifying XSD 1.0 worked.

http://www.saxonica.com/documentation/index.html#!configuration/config-features says, "XSD_VERSION... The default is XSD 1.0." by the way.

RE: 9.8 xs:anyURI is less rigorous? - Added by Debbie Lockett over 7 years ago

Thanks for pointing this out. The specified documentation page has now been updated. (Note that the javadoc FeatureKeys page http://saxonica.com/documentation/index.html#!javadoc/net.sf.saxon.lib/FeatureKeys which contains the same paragraph, will only get updated with the next maintenance release.)

    (1-4/4)

    Please register to reply