--TEST--
XMLReader: libxml2 XML Reader, DTD
--SKIPIF--
--FILE--
Move Title 1
Location 1
Move Title 2
Location 2
';
$dtdfile = rawurlencode(dirname(__FILE__)) . '/dtdexample.dtd';
$file = dirname(__FILE__) . '/__008.xml';
file_put_contents($file, $xmlstring);
$reader = new XMLReader();
$reader->open($file);
$reader->setParserProperty(XMLREADER::LOADDTD, TRUE);
$reader->setParserProperty(XMLREADER::VALIDATE, TRUE);
while($reader->read());
if ($reader->isValid()) {
echo "file DTD: ok\n";
}
$reader->close();
unlink($file);
$xmlstring = '
Move Title 1
Location 1
Move Title 2
Location 2
';
$reader = new XMLReader();
$reader->XML($xmlstring);
$reader->setParserProperty(XMLREADER::LOADDTD, TRUE);
$reader->setParserProperty(XMLREADER::VALIDATE, TRUE);
while($reader->read());
if ($reader->isValid()) {
echo "string DTD: ok\n";
}
?>
===DONE===
--EXPECTF--
file DTD: ok
string DTD: ok
===DONE===