<slide title="DTD Validation">
<blurb>
%LibXML% supports DTD validation, during parsing, and post parsing.
</blurb>
<example title="Parse &amp; Validate">
<![CDATA[<?php
$dom = new domDocument;
$dom->validateOnParse = true;
$dom->load('note-invalid.xml');
?>]]>
</example>
<example title="Parse Then Validate">
<![CDATA[<?php
$dom = new domDocument;
$dom->load('note.xml');
if (!$dom->validate('note.dtd')) {
  print "Document note.dtd is not valid\n";
} else {
  print "Document note.dtd is valid\n";
}
?>]]>
</example>
</slide>
