Mark Wilson I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :
03/24/2008
Times viewed :
1316
DOMDocument Function validate
PHP Version: (No version information might be only in CVS. I have used this function
in PHP5)
DOM: W3C
DOM Level 1
Description
This function is used to validate a document based on
a DTD. In this example, I have loaded DOM Document from a valid XML file and
validated it using against the DTD using validate()
function.
Usage:
boolDOMDocument->validate (
void )
Validates the document based
on its DTD. Please see the example for more details.
Content
of XML file:
This is a valid xml against DTD( Please refer employee.dtd for
content).
<?xml version="1.0"
encoding="UTF-8"?>
<!DOCTYPE employee SYSTEM
"C:/topxml_demo/php/xml_files/employee.dtd">