Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.6.0
-
None
-
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