Hi,

The DOCTYPEs of my XML documents usually specify the name of the DTD
without a path name, e.g. <!DOCTYPE measurement SYSTEM "mm.dtd">.

As long as the DTD file is found in the current directory validation
takes place and the DOM tree is free of additional white space. In case
the DTD file is not found, additional white space is added to the DOM
tree and my application fails (I'm using DOMText::isIgnorableWhiteSpace()).

I have two questions:

 1. is there a way to make the absence of the DTD file a hard error?
    Xerces should throw an exception of the DTD file is not found.

 2. since the binaries of my programs are installed in a system path
    (e.g. /usr/local/bin) and application data resides in
    /usr/local/share/... it is annoying to be forced to keep the DTD
    file in the directory where the parser application is run. It would
    be nice to override the document's DTD spec/system Id with a hard
    coded one (e.g. /usr/local/share/.../mm.dtd).

I made several unsuccessful attempts with DOMReader::loadGrammar() and
XMLUni::fgXercesUseCachedGrammarInParse := true.

Since my documents are fairly complicated I will probably switch to XML
Schema in the near future (in case there is no solution for DTD
validation). Please help :-)

regards,

Michael
-- 

Reply via email to