|
Subject: [xsl] Validate xml against dtd in php From: "Kjellaug Johansen" <kjellaug.johansen@xxxxx> Date: Tue, 9 Sep 2008 11:39:29 +0200 |
Hi.
I want to validate my xml against a dtd located on the disc. Even if I
try to validate xml I know are valid (I've tried to validate it against
the dtd in xmlspy aswell), the result always prints 'Not valid'. Anyone
who knows how I can do this?
<?php
function validate($xmlstring) {
$dtd = "mydtd.dtd";
$dom = new domDocument;
$dom->loadXML($xmlstring);
if (!$dom->validate($dtd))
print "Not valid\n";
else
print "Valid\n";
}
validate("<book><test>hello</test></book>");
?>
Thanks!
Kjellaug.
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Namespace de-duplication , Florent Georges | Thread | [xsl] Searching for specific charac, Sharon_Harris |
| Re: [xsl] Namespace de-duplication , Florent Georges | Date | [xsl] Searching for specific charac, Sharon_Harris |
| Month |