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

Correct regular expression isn't accepted by the JAXP RI (incorrect handling of '$')

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • 9
    • 5.0
    • xml

      The JAXP RI fails to accept the following schema:

      <?xml version="1.0" encoding="UTF-8"?>
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
      <xs:simpleType name="dataType">
      <xs:restriction base="xs:NCName">
      <xs:pattern value="[a-z]$?[a-z]*"/>
      </xs:restriction>
      </xs:simpleType>
      </xs:schema>

      Citing the following error:

      [ERROR] InvalidRegex: Pattern value '[a-z]$?[a-z]*' is not a valid regular expression. The reported error was: 'Unexpected meta character.'.
        line 4 of file:/C:/kohsuke/Sun/JAXB/jaxb-ri/sandbox/test.xsd

      Note that in the XML Schema spec, '$' is not a meta character.
      See http://www.w3.org/TR/xmlschema-2/#nt-Char

            joehw Joe Wang
            kkawagucsunw Kohsuke Kawaguchi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: