It may also return DOMNameSpaceNode if you`re requesting 'xmlns:_prefix_'. So you`re unable to remove it with removeAttributeNode() which requires DOMAttr as parameter.
DOMElement::getAttributeNode
(PHP 5)
DOMElement::getAttributeNode — 属性ノードを返す
パラメータ
- name
-
属性の名前。
返り値
属性ノードを返します。
参考
- DOMElement::hasAttribute() - 属性が存在するかどうかを調べる
- DOMElement::setAttributeNode() - 新しい属性ノードを要素に追加する
- DOMElement::removeAttributeNode() - 属性を削除する
lowezar at gmail dot com
28-Feb-2011 08:22
Alex
18-Feb-2009 08:33
Just trying to add some clarification: this function will return boolean "false" when there is not a $name attribute :)
Cheers, Alex
