mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
28 lines
550 B
PHP
28 lines
550 B
PHP
--TEST--
|
|
XMLReader: libxml2 XML Reader, next
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded("xmlreader")) print "skip"; ?>
|
|
--FILE--
|
|
<?php
|
|
/* $Id$ */
|
|
$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
|
|
<prefix:books xmlns:prefix="uri" isbn="" prefix:isbn="12isbn">book1</prefix:books>';
|
|
|
|
$reader = new XMLReader();
|
|
$reader->XML($xmlstring);
|
|
|
|
// Only go through
|
|
$reader->read();
|
|
$reader->read();
|
|
|
|
$reader->next();
|
|
echo $reader->name;
|
|
echo " ";
|
|
echo $reader->getAttributeNs('isbn', 'uri');
|
|
echo "\n";
|
|
?>
|
|
===DONE===
|
|
--EXPECTF--
|
|
prefix:books 12isbn
|
|
===DONE===
|