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

getElementById failure with attributes derived by restriction from xs::ID

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.6.0
    • None
    • DOM
    • None
    • Win32 VC6

    Description

      Attributes derived by restriction as local simpleType from xs:ID (e.g. by restriction of the allowed ID-names to a predefined pattern) are correctly schema-validated as ID's (e.g., when 2 have the same name this is flagged as error), but are - as far as I can see - not added to DOMNodeIdMap. As a consequence, subsequent calls to getElementByID with these specific ID-names fails and returns null pointers.

      Example:
      <xs:attribute name="id" use="optional">
      <xs:simpleType>
      <xs:restriction base="xs:ID">
      <xs:pattern value="P\d+"/>
      </xs:restriction>
      </xs:simpleType>
      </xs:attribute>

      Calls of getElementByID to elements with this ID attribute fail.

      Removing the restriction:
      <xs:attribute name="id" type="xs:ID" use="optional"/>

      results in working getElementByID calls.

      Although a minor issue, it leads to non-conformant behaviour and should be corrected at some stage.

      Thanks,

      Kris

      Attachments

        Activity

          People

            Unassigned Unassigned
            hobbes007 Kris De Meyer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: