jaxp
  1. jaxp
  2. JAXP-24

jaxp 1.3 failed on well known schema

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      24

      Description

      JAXP 1.3 cannot produce Schema object from the well known XML schema
      http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd
      Try to compile and run the following class

      import javax.xml.validation.*;
      import javax.xml.transform.stream.*;
      import javax.xml.*;

      public class XmlTest3 {
      public static void main(String[] args) {
      try

      { SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); StreamSource schemaSrc = new StreamSource("http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"); Schema schema = factory.newSchema(schemaSrc); System.out.println("Successfully created schema"); System.exit(0); }

      catch(Exception e)

      { System.out.println("Caught exception"); e.printStackTrace(); System.exit(1); }

      }
      }

      You will get the following exception
      org.xml.sax.SAXParseException: InvalidRegex: Pattern value
      '[-+]?(\d+|\d+(\.\d+)?%)' is not a valid regular expression. The reported error
      was: ''-' is an invalid character range. Write '-'.'.

      It seems to me that the regular expression engine used by jaxp 1.3 is more
      restricted than before. jaxp 1.2 works just fine. Of course, the schema could be
      corrected by changing [-+] to [\-+] and this will fix the problem. However, this
      schema is such a well known schema, jaxp 1.3 and jdk1.5 sure will break a lot of
      existing application. Is it possible to relax the restriction on the regular
      expression?

        Activity

        Hide
        Joe Wang added a comment -

        Assigning to Norm

        Show
        Joe Wang added a comment - Assigning to Norm

          People

          • Assignee:
            ndw
            Reporter:
            tryzigc
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: