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

Invalid error when referring an attribute from another namespace in an overridden schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.11.0
    • None
    • None

    Description

      If I validate the "override.xsd" schema with Xerces I get an error. It seems that it cannot resolve the "attr" attribute that is declared in an imported schema.
      I tested on the xml-schema-1.1-dev branch.

      ---- override.xsd------------------
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:imp="importNs" targetNamespace="mainNs">

      <xs:import namespace="importNs" schemaLocation="import.xsd"/>

      <xs:override schemaLocation="extended.xsd">
      <xs:element name="mainElem">
      <xs:complexType>
      <xs:attribute ref="imp:attr"/>
      </xs:complexType>
      </xs:element>
      </xs:override>
      </xs:schema>
      --------------------------------------

      ----------- extended.xsd ----------------
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:imp="importNs" targetNamespace="mainNs">
      <xs:element name="mainElem">
      <xs:complexType>
      <xs:attribute name="myAttr" type="xs:Name"/>
      </xs:complexType>
      </xs:element>
      </xs:schema>
      ---------------------------------------------

      ------- import.xsd-----------------------
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="importNs">
      <xs:attribute name="attr" type="xs:string"/>
      </xs:schema>
      --------------------------------------------

      -------- Error-------------------------------------------
      [Error] :-1:-1: src-resolve.4.2: Error resolving component 'imp:attr'. It was detected that 'imp:attr' is in namespace 'importNs', but components from this namespace are not referenceable from schema document 'null'. If this is the incorrect namespace, perhaps the prefix of 'imp:attr' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'null'.
      ---------------------------------------------------------

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: