Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-1627

Schema validator sensitive to the order of xsd:import and xsd:include elements.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.5.0, 2.6.0, 2.7.0
    • 3.1.0
    • None
    • Windows XP SR2

    Description

      Xerces validating schema parser appears to be intolerant of the order of xsd:import and xsd:include elements.

      This can be demonstrated with the the DOMCount program:
      DOMCount -s -n -v=always CSW_caps.xml

      This causes validation errors by the schema validator unable to resolve types included in owsGetCapabilities. Swapping the order of the
      <xsd:include> to after the <xsd:import> (lines 22-25 of CSW-discovery.xsd) solves the validation error.

      The fragment of XMLSchema.xsd shown below suggests to me that import and include elements can be in any order?

      http://www.w3.org/2001/XMLSchema.xsd:
      <xs:element name="schema" id="schema">
      <xs:annotation>
      <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-schema"/>
      </xs:annotation>
      <xs:complexType>
      <xs:complexContent>
      <xs:extension base="xs:openAttrs">
      <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element ref="xs:include"/>
      <xs:element ref="xs:import"/>
      <xs:element ref="xs:redefine"/>
      <xs:element ref="xs:annotation"/>
      </xs:choice>
      <xs:sequence minOccurs="0" maxOccurs="unbounded">
      <xs:group ref="xs:schemaTop"/>
      <xs:element ref="xs:annotation" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      ...
      ...
      </xs:sequence>
      </xs:extension>
      </xs:complexContent>
      </xs:complexType>
      </xs:element>

      Attachments

        Activity

          People

            Unassigned Unassigned
            petera Peter Aberline
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: