note 47162 rejected from function.dom-domdocument-schemavalidate by betz
| From: | betz@php.net | Date: | Fri, 05 Nov 2004 01:09:49 +0000 |
| Subject: | note 47162 rejected from function.dom-domdocument-schemavalidate by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-80111@lists.php.net to get a copy of this message | ||
Note Submitter: gem at rellim dot com
----
The method schemaValidate() returns TRUE on success or FALSE if a problem is detected.
Generates PHP WARNINGs if the schema is invalid.
Does not generate WARNINGs if the xml is invalid.
<?php
$xml = new DOMDocument();
$xml->load( 'my.xml' );
if ( $xml->schemaValidate( "my.xsd' ) ) {
echo "Validated OK";
} else {
echo "Validate FAILED";
}
?>