<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Validates a document based on a schema</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="domdocument.savexml.html">DOMDocument::saveXML</a></div> <div class="next" style="text-align: right; float: right;"><a href="domdocument.schemavalidatesource.html">DOMDocument::schemaValidateSource</a></div> <div class="up"><a href="class.domdocument.html">DOMDocument</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="domdocument.schemavalidate" class="refentry"> <div class="refnamediv"> <h1 class="refname">DOMDocument::schemaValidate</h1> <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">DOMDocument::schemaValidate</span> — <span class="dc-title"> Validates a document based on a schema </span></p> </div> <div class="refsect1 description" id="refsect1-domdocument.schemavalidate-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>DOMDocument::schemaValidate</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span> [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code></span> ] )</div> <p class="para rdfs-comment"> Validates a document based on the given schema file. </p> </div> <div class="refsect1 parameters" id="refsect1-domdocument.schemavalidate-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">filename</code></em></span> <dd> <p class="para"> The path to the schema. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">flags</code></em></span> <dd> <p class="para"> A bitmask of Libxml schema validation flags. Currently the only supported value is <a href="libxml.constants.html" class="link">LIBXML_SCHEMA_CREATE</a>. Available since PHP 5.5.2 and Libxml 2.6.14. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-domdocument.schemavalidate-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 changelog" id="refsect1-domdocument.schemavalidate-changelog"> <h3 class="title">Changelog</h3> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>Version</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>5.5.2</td> <td> Added the <em><code class="parameter">flags</code></em> parameter </td> </tr> </tbody> </table> </p> </div> <div class="refsect1 seealso" id="refsect1-domdocument.schemavalidate-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="methodname"><a href="domdocument.schemavalidatesource.html" class="methodname" rel="rdfs-seeAlso">DOMDocument::schemaValidateSource()</a> - Validates a document based on a schema</span></li> <li class="member"> <span class="methodname"><a href="domdocument.relaxngvalidate.html" class="methodname" rel="rdfs-seeAlso">DOMDocument::relaxNGValidate()</a> - Performs relaxNG validation on the document</span></li> <li class="member"> <span class="methodname"><a href="domdocument.relaxngvalidatesource.html" class="methodname" rel="rdfs-seeAlso">DOMDocument::relaxNGValidateSource()</a> - Performs relaxNG validation on the document</span></li> <li class="member"> <span class="methodname"><a href="domdocument.validate.html" class="methodname" rel="rdfs-seeAlso">DOMDocument::validate()</a> - Validates the document based on its DTD</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="domdocument.savexml.html">DOMDocument::saveXML</a></div> <div class="next" style="text-align: right; float: right;"><a href="domdocument.schemavalidatesource.html">DOMDocument::schemaValidateSource</a></div> <div class="up"><a href="class.domdocument.html">DOMDocument</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>