Reputation: 8990
i have this xml file called data_out.xml, and i want to do DTD and SCHEMA checks on the xml file using SIMPLEXML and php. thank you very much :))
Upvotes: 3
Views: 1716
Reputation: 27323
Simplexml won't do it but DomDocument can do it. Also the xml should have some link to the DTD file.
<?php
$dom = new DOMDocument;
$dom->Load('book.xml');
if ($dom->validate()) {
echo "This document is valid!\n";
}
?>
you can take a look at this question for more references
Upvotes: 2