Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8015092

SchemaFactory cannot parse schema if whitespace added within patterns in Selector XPath expression

    XMLWordPrintable

Details

    • b113
    • generic
    • generic

    Backports

      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.

        Attachments

          Issue Links

            Activity

              People

                joehw Joe Wang
                lkuskov Leonid Kuskov
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: