note 74688 added to function.dom-domdocument-createelementns
| From: | primaryspace at hotmail dot com | Date: | Mon, 23 Apr 2007 18:25:43 +0000 |
| Subject: | note 74688 added to function.dom-domdocument-createelementns | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125802@lists.php.net to get a copy of this message | ||
Passing null as the first value ($namespaceURI) results in the creation of a node without a
namespace associated with it, just as though createElement() were called.
<?php
$dom = new DOMDocument('1.0');
$dom->loadXML('<root/>');
$el = $dom->createElementNS(null, 'node', 'value');
$dom->documentElement->appendChild($el);
print $dom->saveXML();
/*
Output:
<?xml version="1.0" ?>
<root>
<node>value</node>
</root>
*/
?>
----
Server IP: 66.207.199.35
Probable Submitter: 216.201.96.61
----
Manual Page -- http://www.php.net/manual/en/function.dom-domdocument-createelementns.php
Edit -- https://master.php.net/note/edit/74688
Del: integrated -- https://master.php.net/note/delete/74688/integrated
Del: useless -- https://master.php.net/note/delete/74688/useless
Del: bad code -- https://master.php.net/note/delete/74688/bad+code
Del: spam -- https://master.php.net/note/delete/74688/spam
Del: non-english -- https://master.php.net/note/delete/74688/non-english
Del: in docs -- https://master.php.net/note/delete/74688/in+docs
Del: other reasons-- https://master.php.net/note/delete/74688
Reject -- https://master.php.net/note/reject/74688
Search -- https://master.php.net/manage/user-notes.php