XMLReader
PHP 手册

XMLReader::setSchema

(PHP 5 >= 5.2.0)

XMLReader::setSchemaValidate document against XSD

说明

bool XMLReader::setSchema ( string $filename )

Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read().

参数

filename

The filename of the XSD schema.

返回值

如果成功则返回 TRUE,失败则返回 FALSE

错误/异常

Issues E_WARNING if libxml was built without schema support, the schema contains errors or if XMLReader::read() has already been called.

注释

Caution

This function is only available when PHP is compiled against libxml 20620 or later.

参见


XMLReader
PHP 手册