JDK-8015092 : SchemaFactory cannot parse schema if whitespace added within patterns in Selector XPath expression
  • 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-05-19
  • Updated Date: 2014-02-12
  • Resolved Date: 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 Availabitlity Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u60Fixed 8 b113Resolved
Related Reports
Relates :  
Description
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.

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

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.
2011-01-19