xref: /PHP-7.1/ext/xmlreader/tests/009.phpt (revision 7af945e2)
1--TEST--
2XMLReader: libxml2 XML Reader, next
3--SKIPIF--
4<?php if (!extension_loaded("xmlreader")) print "skip"; ?>
5--FILE--
6<?php
7/* $Id$ */
8
9$xmlstring = '<?xml version="1.0" encoding="UTF-8"?>
10<books><book num="1"><test /></book><book num="2" /></books>';
11
12$reader = new XMLReader();
13$reader->XML($xmlstring);
14
15// Only go through
16$reader->read();
17$reader->read();
18
19$reader->next();
20echo $reader->name;
21echo " ";
22echo $reader->getAttribute('num');
23echo "\n";
24?>
25===DONE===
26--EXPECTF--
27book 2
28===DONE===
29