JDK-8015092 : SchemaFactory cannot parse schema if whitespace added within patterns in Selector XPath expression
  • 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-05-19
  • Updated: 2014-02-12
  • Resolved: 2013-10-15
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
Related Reports
Relates :  
4 JCK tests (idI021.xsd, idJ029.xsd schema attached) use the xpath expression '. //.' in a selector and in a field. 

Although the specification (http://www.w3.org/TR/xmlschema-1/#coss-identity-constraint) states:
For readability, whitespace may be used in selector XPath expressions even though not explicitly allowed by the grammar: 
whitespace may be freely added within patterns before or after any token. 
Lexical productions
[5]   	token	   ::= 	'.' | '/' | '//' | '|' | '@' | NameTest
[6]   	whitespace ::=  (#x20 | #x9 | #xD | #xA)+   	
When tokenizing, the longest possible token is always returned.

The parser ( schemaFactory.newSchema( schemaSources ) ) fails with exception
c-general-xpath: The expression '. //.' is not valid with respect to the XPath subset supported by XML Schema.

I suppose if whitespace may be used in a XPath expressions and they should be eliminated while the selector is being parsed then this issue is rather JAXP issue then JCK

EVALUATION Refer to 4988387. The JCK also contains the following negative tests: api/xml_schema/msxsdtest/identityConstraint/idJ030.html#idJ030 api/xml_schema/msxsdtest/identityConstraint/idJ008.html#idJ008 api/xml_schema/msxsdtest/identityConstraint/idJ017.html#idJ017 api/xml_schema/msxsdtest/identityConstraint/idJ015.html#idJ015 api/xml_schema/msxsdtest/identityConstraint/idI022.html#idI022 api/xml_schema/msxsdtest/identityConstraint/idI016.html#idI016 api/xml_schema/msxsdtest/identityConstraint/idI014.html#idI014 api/xml_schema/msxsdtest/identityConstraint/idI007.html#idI007 Fixing this would break the above JCK tests. Because of the existence of conflicting tests in the W3C testsuite, I suggest we continue excluding this tests. Thx.