note 84090 added to domdocument.createattribute
| From: | adolfoaguirredotcomdotmx at osu1 dot php dot net | Date: | Fri, 27 Jun 2008 02:21:45 +0000 |
| Subject: | note 84090 added to domdocument.createattribute | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140860@lists.php.net to get a copy of this message | ||
// create a xml document
$dom_xml = new DomDocument('1.0');
// for a fast example, an xml node youve creater some there
$element=$dom_xml->createElement("item");
$item_xml =$dom_xml->appendChild($element);
// now you wish an id attribute inside
// create and append the id attribute
$element=dom_xml->createAttribute("id");
$id_attribute=$item_xml->appendChild($element);
// populate the attribute
$element=$dom_xml->createTextNode(12)
$id_attribute->appendChild($element);
//
... y listo!
so you will have in your xml something like ... <item id="12">
hehe, este es mi primer código en php
y ya los estoy mal encaminando a ustedes que me hagan caso.
----
Server IP: 200.36.127.20
Probable Submitter: 189.137.46.53
----
Manual Page -- http://www.php.net/manual/en/domdocument.createattribute.php
Edit -- https://master.php.net/note/edit/84090
Del: integrated -- https://master.php.net/note/delete/84090/integrated
Del: useless -- https://master.php.net/note/delete/84090/useless
Del: bad code -- https://master.php.net/note/delete/84090/bad+code
Del: spam -- https://master.php.net/note/delete/84090/spam
Del: non-english -- https://master.php.net/note/delete/84090/non-english
Del: in docs -- https://master.php.net/note/delete/84090/in+docs
Del: other reasons-- https://master.php.net/note/delete/84090
Reject -- https://master.php.net/note/reject/84090
Search -- https://master.php.net/manage/user-notes.php