This section describes the built-in primitive datatype, 'anyURI' that represents IRI (Internationalized Resource Identifier) values. Leading and trailing whitespaces are allowed and trimmed.
"anyURI" is a built-in datatype that represents URI values as defined in
"RFC3987 - Internationalized Resource Identifiers (IRIs)"
with these rules:
The value space of "anyURI" is all possible "URI" values.
The lexical space of "anyURI" is all possible "anyURI" values represented in
the format defined in "RFC3987 - Internationalized Resource Identifiers (IRIs)".
Leading and trailing whitespaces allowed and trimmed.
Note that IRI supports right-to-left writings. So:
"mus#321=dis?lmth.xedni/DSX/moc.gnaygnoreh//:ptth" is a valid "anyURI" representation.
To verify these rules, I wrote this simple XSD document that uses "anyURI" datatype to declare XML elements:
When validating this XML document with my XsdSchemaValidator.java program presented earlier in the book,
I get 2 groups of errors for 2 invalid XML elements:
c:\Progra~1\Java\jdk1.7.0_07\bin\java XsdSchemaValidator
anyURI_datatype_test.xsd anyURI_datatype_test.xml
Error:
Line number: 18
Column number: 47
Message: cvc-datatype-valid.1.2.1: 'any_string:anystring' is not
a valid value for 'anyURI'.
Error:
Line number: 18
Column number: 47
Message: cvc-type.3.1.3: The value ' any_string:anystring '
of element 'AnyURI' is not valid.
Error:
Line number: 19
Column number: 42
Message: cvc-datatype-valid.1.2.1: 'any@string:http' is not a valid
value for 'anyURI'.
Error:
Line number: 19
Column number: 42
Message: cvc-type.3.1.3: The value ' any@string:http ' of
element 'AnyURI' is not valid.
Failed with errors: 4