【发布时间】:2013-03-06 14:03:21
【问题描述】:
验证任何 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 都不包含或不需要名称为 的标记或元素。
用同样的方法尝试
$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一样。
知道如何解决这个问题吗?
【问题讨论】:
-
你能发布$xml_input的内容吗?