]> granicus.if.org Git - php/commit
Fix bug #54382 (getAttributeNodeNS doesn't get xmlns* attributes)
authorArnout Boks <arnoutboks@gmail.com>
Wed, 25 Jan 2017 20:09:03 +0000 (21:09 +0100)
committerJoe Watkins <krakjoe@php.net>
Wed, 25 Jan 2017 20:59:25 +0000 (20:59 +0000)
commit721a189742acc6fb6c2c6d98ce86eebe4e34d42a
treed21a5f709c4a12b653ca26a842df0a10465a5460
parent737ee0661c15f5eb812467c3e10ee1f784691be9
Fix bug #54382 (getAttributeNodeNS doesn't get xmlns* attributes)

The fix is based on the same strategy for handling namespace
declarations as used by getAttributeNode. Note that this strategy makes
these methods not return a DOMAttr for xmlns* attributes, but an
instance of the (undocumented) class DOMNameSpaceNode. This is not
really ideal, but at least this fix makes the behavior of
getAttributeNode and getAttributeNodeNS consistent.

A follow-up action would be to investigate whether DOMNameSpaceNode can
be made into a subclass of DOMAttr (which may be hard due to the way
libxml treats namespace declarations) or document this deviating return
value for xmlns* attributes.
ext/dom/element.c