note 74386 added to ref.simplexml
| From: | http://methylblue dot com at osu1 dot php dot net | Date: | Mon, 09 Apr 2007 00:14:07 +0000 |
| Subject: | note 74386 added to ref.simplexml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125233@lists.php.net to get a copy of this message | ||
It is a grave misfortune that this doesn't work:
<?
$node = new SimpleXml;
echo $node->{"namespace:tagname"}[attribute'];
?>
Instead you have to go through loops!
<?
$namespace = $node->children( 'namespace' );
$attributes = $namespace->tagname->attributes;
echo $attribute['attribute'];
?>
AFAICT there is no simpler way. SimpleXml is great in premise, but useless for things like RSS
feeds, which lets face it, most PHP development with XML is about.
Great shame!
----
Server IP: 194.145.210.3
Probable Submitter: 83.146.10.162
----
Manual Page -- http://www.php.net/manual/en/ref.simplexml.php
Edit -- https://master.php.net/note/edit/74386
Del: integrated -- https://master.php.net/note/delete/74386/integrated
Del: useless -- https://master.php.net/note/delete/74386/useless
Del: bad code -- https://master.php.net/note/delete/74386/bad+code
Del: spam -- https://master.php.net/note/delete/74386/spam
Del: non-english -- https://master.php.net/note/delete/74386/non-english
Del: in docs -- https://master.php.net/note/delete/74386/in+docs
Del: other reasons-- https://master.php.net/note/delete/74386
Reject -- https://master.php.net/note/reject/74386
Search -- https://master.php.net/manage/user-notes.php