JDK-8015243 : SchemaFactory does not catch enum. value that is not in the value space of the base type, anyURI.
  • Type: Bug
  • Status: Resolved
  • Resolution: Fixed
  • Component: xml
  • Sub-Component: jaxp
  • Priority: P3
  • Affected Version: jaxp_1.5,8
  • OS: generic
  • CPU: generic
  • Submit Date: 2010-04-08
  • Updated Date: 2014-02-12
  • Resolved Date: 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 Availabitlity Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u60Fixed 8 b113Resolved
Description
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);
 sf.setErrorHandler(errorCollector);
 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

Comments
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.
2013-10-15

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
2013-05-22

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".
2010-12-03