Open In App

PHP | DOMDocument relaxNGValidate() Function

The DOMDocument::relaxNGValidate() function is an inbuilt function in PHP which is used to performs relaxNG validation on the document. The relaxNG is an alternative to DDT and defines a structure which needs to be followed by the XML document.

Syntax:



bool DOMDocument::relaxNGValidate( string $filename )

Parameters: This function accepts a single parameter $filename which holds the RNG file.

Return Value: This function returns TRUE on success or FALSE on failure.



Below given programs illustrate the DOMDocument::relaxNGValidate() function in PHP:

Program 1:

Program 2:

Reference: https://www.php.net/manual/en/domdocument.relaxngvalidate.php


Article Tags :