note 7854 deleted from ref.domxml by sniper
| From: | sniper@php.net | Date: | Mon, 03 Nov 2003 15:48:24 +0000 |
| Subject: | note 7854 deleted from ref.domxml by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59720@lists.php.net to get a copy of this message | ||
Note Submitter: marcel.schwarz@mikan.de
----
Maybe it is of interest for someone:
This is an example for getting the attribute of a
node "article" using the xmldoc-function.
<?php
$docnode = xmldoc("<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n".
"<!DOCTYPE webdoctype SYSTEM \"webdoc.dtd\">\n".
"<webdoc>\n".
" <article id=\"651\"/>\n".
"</webdoc>\n");
$node = $docnode->children();
$node = $node[1]->children();
$attr = $node[1]->attributes();
printf("%s=%s", $attr[0]->name, $attr[0]->children[0]->content);
?>