예제 #1
0
파일: note.php 프로젝트: cefalo19/php-src
<?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";
}
$dom = new domDocument();
$dom->load('note-invalid.xml');
if (!$dom->validate('note.dtd')) {
    print "Document note-invalid.xml is not valid\n";
} else {
    print "Document note-invalid.xml is valid\n";
}
예제 #2
0
<?php

$dom = new domDocument();
$dom->load(dirname(__FILE__) . "/thedata.xml");
if (@$dom->validate()) {
    echo "Document is valid";
} else {
    echo "Document is invalid";
}