--TEST-- XMLReader: libxml2 XML Reader, DTD --SKIPIF-- --FILE-- Move Title 1 Location 1 Move Title 2 Location 2 '; $dtdfile = rawurlencode(__DIR__) . '/dtdexample.dtd'; $file = __DIR__ . '/_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=== --EXPECT-- file DTD: ok string DTD: ok ===DONE===