PHP | XMLReader setRelaxNGSchemaSource() Function
Last Updated :
18 Mar, 2020
The XMLReader::setRelaxNGSchemaSource() function is an inbuilt function in PHP which is used to set the data containing a RelaxNG Schema to use for validation. The setRelaxNGSchemaSource() function is different from setRelaxNGSchema() function as the former accepts the rule as a string variable whereas later function accepts the rule as a .rng file.
Syntax:
bool XMLReader::setRelaxNGSchemaSource( string $source )
Parameters: This function accepts a single parameter $source which holds the string containing the RelaxNG Schema.
Return Value: This function returns TRUE on success or FALSE on failure.
Below examples illustrate the XMLReader::setRelaxNGSchemaSource() function in PHP:
Example 1:
Example 2:
Reference: https://www.php.net/manual/en/xmlreader.setrelaxngschemasource.php
Share your thoughts in the comments
Please Login to comment...