Hi,
I'd like to know how to force PHP validate with a given DTD. The XMLs are like:
[FONT="Courier New"]<?xml version="1.0"?>
<!DOCTYPE abc PUBLIC "-//OASIS//DTD ABC Composite//EN" "abc.dtd">[/FONT]
but to get them validated by using
[FONT="Courier New"]$dom = DOMDocument::load($file);
$dom->validate();[/FONT]
the "abc.dtd" cannot be found. So when I change "abc.dtd" to "D:\Engines\dtd\abc.dtd" then it validates fine.
However, I cannot change the path to "abc.dtd" in XML files at all due many reasons. I just would like to specify the path to the DTD I want to use for validation externally and subsequently have the "abc.dtd" in in XML files ignored.
Is there a way to do it in PHP? Is there something like DOMDocument->validateSource() ? Something similar to
DOMDocument->schemaValidateSource() and
DOMDocument->relaxNGValidateSource().
In DOMDocument->validate() DTD source cannot be specified.
Any help appreciated.
Nick