note 106566 added to simplexmlelement.addattribute
| From: | p dot servus at osu1 dot php dot net | Date: | Sat, 19 Nov 2011 01:42:48 +0000 |
| Subject: | note 106566 added to simplexmlelement.addattribute | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184569@lists.php.net to get a copy of this message | ||
If you need an Namespace, you must write a Prefix of the Namespace + the Name of the Attribute
("prefix:name") as the first parameter AND the uri as the third one. (I don't know
why?!)
Example code:
<?php
$xml = new SimpleXMLElement("<packagedElement></packagedElement>");
$xml->addAttribute("xmi:type", "uml:Class", "http://schema.omg.org/spec/XMI/2.1");
echo $xml->asXml();
?>
Output:
<packagedElement xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmi:type="uml:Class"></packagedElement>
----
Server IP: 69.147.83.197
Probable Submitter: 85.179.132.114
----
Manual Page -- http://www.php.net/manual/en/simplexmlelement.addattribute.php
Edit -- https://master.php.net/note/edit/106566
Del: integrated -- https://master.php.net/note/delete/106566/integrated
Del: useless -- https://master.php.net/note/delete/106566/useless
Del: bad code -- https://master.php.net/note/delete/106566/bad+code
Del: spam -- https://master.php.net/note/delete/106566/spam
Del: non-english -- https://master.php.net/note/delete/106566/non-english
Del: in docs -- https://master.php.net/note/delete/106566/in+docs
Del: other reasons-- https://master.php.net/note/delete/106566
Reject -- https://master.php.net/note/reject/106566
Search -- https://master.php.net/manage/user-notes.php