note 55697 added to function.dom-domelement-removeattributens
| From: | primaryspace at hotmail dot com | Date: | Wed, 10 Aug 2005 19:56:07 +0000 |
| Subject: | note 55697 added to function.dom-domelement-removeattributens | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93394@lists.php.net to get a copy of this message | ||
This method can be used to remove a namespace declaration from an element, even though the
declaration is not considered an attribute by the DOM. The prefix will be removed from any element
or attribute using it.
<?php
$dom = DOMDocument::loadXML('<foo:root xmlns:foo="http:bar"/>');
$element = $dom->childNodes->item(0);
// prints '0':
echo (int) $element->hasAttributeNS('http:bar',
'foo');
$element->removeAttributeNS('http:bar', 'foo');
/* prints '<?xml version="1.0"?> <root/>': */
print htmlentities($dom->saveXML());
?>
----
Manual Page -- http://www.php.net/manual/en/function.dom-domelement-removeattributens.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55697
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55697&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55697&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55697&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55697&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55697&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55697&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55697&report=yes
Search -- http://master.php.net/manage/user-notes.php