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

XSD: XML Schema erratum E2-66 is not supported by schema validator

    Details

      Description

      JAXP RI 1.4\JDK 6 does not support XML Schema specification erratum E2-66 [1].
      The erratum says:
      "Schema Component Constraint: length and minLength or maxLength
      If length is a member of {facets} then
      1 It is an error for minLength to be a member of {facets} unless
      1.1 the {value} of minLength <= the {value} of length and
      1.2 there is type definition from which this one is derived by one or more restriction steps in which minLength has the same {value} and length is not specified.
      2 It is an error for maxLength to be a member of {facets} unless
      2.1 the {value} of length <= the {value} of maxLength and
      2.2 there is type definition from which this one is derived by one or more restriction steps in which maxLength has the same {value} and length is not specified."
      This text was added into XML specification Schema 1.0, 2nd Edition [2] and it is normative.
      This erratum supersedes previous erratum E2-35 [3].

      Attached test schema errF001.xsd is treated by RI as valid, while it is not, according to the Errata. In the schema simple type "st" which contains facet "length" is restricted by simple type "st2" which contains "maxLength" facet. But according to the erratum, "maxLength" can only be specified some steps before "length" in a chain of restrictions.

      How to reproduce:
      the test is presented in JCK 6a [4], you can run this test:
      "/java/re/jdk/6/promoted/fcs/b105/binaries/solaris-sparc/bin/java -cp /java/re/jck/6a/promoted/fcs/b14/binaries/JCK-runtime-6a/classes javasoft.sqe.tests.api.xml.schema.TestRun -negative -t file:///java/re/jck/6a/promoted/fcs/b14/binaries/JCK-runtime-6a/tests/xml_schema/msData/errata10/jaxp/errF001.html#errF001.i -s ../errF001.xsd ../errF001.xml"
      Only errors in XML file are reported, schema treated as valid.
      If to run test with only schema, it'll pass:
      "/java/re/jdk/6/promoted/fcs/b105/binaries/solaris-sparc/bin/java -cp /java/re/jck/6a/promoted/fcs/b14/binaries/JCK-runtime-6a/classes javasoft.sqe.tests.api.xml.schema.TestRun -t file:///java/re/jck/6a/promoted/fcs/b14/binaries/JCK-runtime-6a/tests/xml_schema/msData/errata10/jaxp/errF001.html#errF001.i -s ../errF001.xsd"

      [1] http://www.w3.org/2001/05/xmlschema-errata#e2-66
      [2] http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#length-coss
      [3] http://www.w3.org/2001/05/xmlschema-errata#e2-35
      [4] SWAN: /java/re/jck/6a/promoted/fcs/b14/binaries/JCK-runtime-6a

        Attachments

          Activity

            People

            • Assignee:
              joehw Joe Wang
              Reporter:
              ashurygisunw Alexey Shurygin (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: