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

illegal nomination is allowed

XMLWordPrintable

    • generic
    • generic

      Name: erR10175 Date: 06/03/2002


        TCK test
      api/xml_schema/structures/ElemDecl/substGroupExclusions/substGroupExclusions003/substGrpExcl00301m/substGrpExcl00301m2.html#Negative

      shows that if both restriction and extension are ruled out, the declaration
      may be nominated as the {substitution group affiliation} of *another* declaration
      with the same type.

      But the specification (XML Schema Part 1: Structures, 3.3 Element Declarations) reads:
      "An empty {substitution group exclusions} allows a declaration to be nominated as the
      {substitution group affiliation} of other element declarations having the same
      {type definition} or types derived therefrom. The explicit values of
      {substitution group exclusions} rule out element declarations having types which are
      extensions or restrictions respectively of {type definition}. If both values are specified,
      then the declaration may not be nominated as the {substitution group affiliation} of
      *any* other declaration."

      To reproduce the bug validate the following schema and document.
      The validation unexpectedly passes without an error.
      ------------------ substGrpExcl00301m2.xsd
      <xsd:schema
        xmlns="ElemDecl/substGroupExclusions"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        targetNamespace="ElemDecl/substGroupExclusions"
        elementFormDefault="qualified">

        <xsd:element name="root">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="Head" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>

        <xsd:element name="Head" type="HeadType" final="restriction extension"/>

        <xsd:complexType name="HeadType">
            <xsd:sequence>
                <xsd:element name="Ear"/>
                <xsd:element name="Eye"/>
            </xsd:sequence>
        </xsd:complexType>

        <xsd:element name="Member1" type="HeadType" substitutionGroup="Head"/>

      </xsd:schema>

      ------------------ substGrpExcl00301m2_n.xml
      <root xmlns="ElemDecl/substGroupExclusions"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="ElemDecl/substGroupExclusions substGrpExcl00301m2.xsd">
       <Head> <Ear /> <Eye /> </Head>
      </root>


      ======================================================================

            nwalshsunw Norman Walsh (Inactive)
            reysunw Rey Rey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: