= 5.2.0, PHP 7, PHP 8)XMLReader::setSchema — Validate document against XSD說明public XMLReader::setSchema(?string $filename)">

XMLReader::setSchema

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

XMLReader::setSchemaValidate document against XSD

說明

public XMLReader::setSchema(?string $filename): bool

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

參數(shù)

filename

The filename of the XSD schema.

返回值

成功時(shí)返回 true, 或者在失敗時(shí)返回 false。

錯(cuò)誤/異常

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

注釋

警告

此函數(shù)僅在 PHP 與 libxml 20620 或以上版本編譯時(shí)可用。

參見