United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-8015092 : SchemaFactory cannot parse schema if whitespace added within patterns in Selector XPath expression

Details
Type:
Bug
Submit Date:
2010-05-19
Status:
Resolved
Updated Date:
2014-02-12
Project Name:
JDK
Resolved Date:
2013-10-15
Component:
xml
OS:
generic
Sub-Component:
jaxp
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
jaxp_1.5,8
Fixed Versions:

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

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
URL:   http://hg.openjdk.java.net/jdk8/jdk8/jaxp/rev/eb169222d3f2
User:  lana
Date:  2013-10-22 16:29:10 +0000

                                     
2013-10-22
URL:   http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/50e88f25255f
User:  lana
Date:  2013-10-22 17:23:08 +0000

                                     
2013-10-22
URL:   http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/eb169222d3f2
User:  joehw
Date:  2013-10-15 05:08:18 +0000

                                     
2013-10-15
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/50e88f25255f
User:  joehw
Date:  2013-10-15 05:29:06 +0000

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



Hardware and Software, Engineered to Work Together