验证任何 VAST2.0 XML 代码
$xsdPath='https://github.com/chrisdinn/vast/blob/master/lib/vast_2.0.1.xsd'
$domdoc= new DOMDocument();
$domdoc->loadHTML($xml_input);
if(!$domdoc->schemaValidate($xsdPath)){/* ... */}
返回无意义的消息,例如Error 1845: Element 'html': No matching global declaration available for the validation root.
在我看来,这并没有真正的意义,因为模式 xsd 和庞大的 xml 都不包含或不需要带有 name 的标记或元素。
尝试相同的
$reader = new XMLReader();
$reader->XML($xml_input);
$valid = $reader->setSchema($xsdPath);
$reader->read();
$reader->close();
返回相同的错误代码。
我检查了xsd twiche。这和https://github.com/chrisdinn/vast/blob/master/lib/vast_2.0.1.xsd上的一样。
知道如何解决这个问题吗?