Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1628

Error when inserting invalid characters in the value of the maxVersion or maxVersion attributes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 2.11.0
    • 2.12.0
    • None

    Description

      If I insert invalid characters in the value of the maxVersion or maxVersion attributes, Xerces reports an error with the reason "null".
      In the SchemaDOMParser, when the value of the attributes is parsed, a NumberFormatException is thrown, that has the message null. This message is then passed to the error reporter.
      I tested on the xml-schema-1.1-dev branch.

      --------- Schema.xsd -------------------
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
      vc:maxVersion="1.1s" vc:minVersion="1.0a"> </xs:schema>
      -----------------------------------------

      ---------- Error ------------------
      s4s-att-invalid-value: Invalid attribute value for 'minVersion' in element 'schema'. Recorded reason: null
      at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:196)
      at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:132)
      at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:394)
      at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)
      at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:282)
      at org.apache.xerces.impl.xs.opti.SchemaDOMParser.checkVersionControlAttributes(SchemaDOMParser.java:635)
      at org.apache.xerces.impl.xs.opti.SchemaDOMParser.startElement(SchemaDOMParser.java:260)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:283)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:733)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1754)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324)
      at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(SchemaParsingConfig.java:627)
      at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.parse(SchemaParsingConfig.java:683)
      at org.apache.xerces.impl.xs.opti.SchemaDOMParser.parse(SchemaDOMParser.java:587)
      at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:2446)
      at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:644)
      at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:644)
      at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:611)
      at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:577)
      at org.apache.xerces.jaxp.validation.BaseSchemaFactory.newSchema(BaseSchemaFactory.java:223)
      at org.apache.xerces.jaxp.validation.XMLSchema11Factory.newSchema(XMLSchema11Factory.java:1)
      --------------------------------

      Attachments

        Activity

          People

            mukul_gandhi Mukul Gandhi
            octavian.nadolu Octavian Nadolu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: