home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2001 August
/
PCWorld_2001-08_cd.bin
/
Komunikace
/
phptriad
/
phptriadsetup2-11.exe
/
php
/
pear
/
XML
/
tests
/
parser3.t
< prev
next >
Wrap
Text File
|
2000-07-30
|
982b
|
44 lines
<?php // -*- C++ -*-
//
// Test for: XML/Parser.php
// Parts tested: - parser creation
// - some handlers
// - parse from file handle
//
require_once "XML/Parser.php";
class __TestParser3 extends XML_Parser {
function __TestParser3() {
$this->XML_Parser();
}
function startHandler($xp, $element, $attribs) {
print "<$element";
reset($attribs);
while (list($key, $val) = each($attribs)) {
$enc = htmlentities($val);
print " $key=\"$enc\"";
}
print ">";
}
function endHandler($xp, $element) {
print "</$element>\n";
}
function cdataHandler($xp, $cdata) {
print "<![CDATA[$cdata]]>";
}
function defaultHandler($xp, $cdata) {
}
}
print "new __TestParser3 ";
var_dump(get_class($o = new __TestParser3()));
print "fopen ";
var_dump($fp = fopen("parser3.i", "r"));
print "setInput ";
var_dump($o->setInput($fp));
print "parse ";
var_dump($o->parse());
?>