JDK-8015243 : SchemaFactory does not catch enum. value that is not in the value space of the base type, anyURI.
  • Type: Bug
  • Component: xml
  • Sub-Component: jaxp
  • Affected Version: jaxp_1.5,8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-04-08
  • Updated: 2014-02-12
  • Resolved: 2013-10-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
7u60Fixed 8 b113Fixed
Attached schema (anyURI_b006.xsd) holds invalid instance of xs:anyURI. The piece of code that compiles it
 SchemaFactory sf = SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
 Schema schema = sf.newSchema( new File("anyURI_b006.xsd"));
does not throw SAXException:
ERROR] enumeration-valid-restriction: Enumeration value '\\' is not in the value space of the base type, anyURI.
as expected.

See also the bug http://www.w3.org/Bugs/Public/show_bug.cgi?id=4048

According to https://www.w3.org/Bugs/Public/show_bug.cgi?id=4048, the invalid enumeration value in anyURI_b006 is: //. Backslashes are not interpreted as path separators but they are allowed in xs:anyURI values, "file:///c:\foo\bar.jpg" for example, is valid xs:anyURI value.

Tested xsd still contains invalid enumeration value: \\ Schema can be loaded by factory.newSchema(new File("anyURI_b006.xsd")) without warnings/errors despite on invalid instance of xs:anyURI

EVALUATION From the last note of http://www.w3.org/Bugs/Public/show_bug.cgi?id=4048, it seems to me the test had been marked invalid, so I think we need to exclude this one from the jck. Quote from the last note of bug 4048: Perhaps we should mark these particular tests as invalid, but add a note saying the rules are fuzzy. Decision: mark the expected result as "invalid".