note 61783 added to ref.xmlreader
| From: | ArielGonzalez at osu1 dot php dot net | Date: | Sat, 11 Feb 2006 22:09:50 +0000 |
| Subject: | note 61783 added to ref.xmlreader | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-103531@lists.php.net to get a copy of this message | ||
Simple function I used while playing around with XMLReader.
<?php
function dump_xmlreader($o) {
$node_types = array (
0=>"No node type",
1=>"Start element",
2=>"Attribute node",
3=>"Text node",
4=>"CDATA node",
5=>"Entity Reference node",
6=>"Entity Declaration node",
7=>"Processing Instruction node",
8=>"Comment node",
9=>"Document node",
10=>"Document Type node",
11=>"Document Fragment node",
12=>"Notation node",
13=>"Whitespace node",
14=>"Significant Whitespace node",
15=>"End Element",
16=>"End Entity",
17=>"XML Declaration node"
);
echo "attributeCount = " . $o->attributeCount . "\n";
echo "baseURI = " . $o->baseURI . "\n";
echo "depth = " . $o->depth . "\n";
echo "hasAttributes = " . ( $o->hasAttributes ? 'TRUE' : 'FALSE' )
. "\n";
echo "hasValue = " . ( $o->hasValue ? 'TRUE' : 'FALSE' ) .
"\n";
echo "isDefault = " . ( $o->isDefault ? 'TRUE' : 'FALSE' ) .
"\n";
echo "isEmptyElement = " . ( @$o->isEmptyElement ? 'TRUE' :
'FALSE' ) . "\n";
echo "localName = " . $o->localName . "\n";
echo "name = " . $o->name . "\n";
echo "namespaceURI = " . $o->namespaceURI . "\n";
echo "nodeType = " . $o->nodeType . ' - ' . $node_types[$o->nodeType] .
"\n";
echo "prefix = " . $o->prefix . "\n";
echo "value = " . $o->value . "\n";
echo "xmlLang = " . $o->xmlLang . "\n";
}
?>
----
Server IP: 64.246.30.37
Probable Submitter: 72.50.19.173
----
Manual Page -- http://www.php.net/manual/en/ref.xmlreader.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61783
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61783&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61783&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61783&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61783&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61783&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61783&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61783&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61783&report=yes
Search -- http://master.php.net/manage/user-notes.php