[xml] XML validation


I need to validate an XML file received via e-mail.
It has no <!DOCTYPE element.
The DTD file is stored locally (on the receiving system).
Reading some thread on this list and the documentation I have understood that 
the best validation can be obtained if the DTD file is referenced by the 
XML file.

Since the XML file is a short file, my idea is to add the line

 <!DOCTYPE eulotnw SYSTEM "/dtd/xxxx.dtd">

to the file, before to pass it to 

  xmlCtxtReadFile(pctxt, xmlfilename, NULL, XML_PARSE_DTDVALID);

Is this a good idea to get the best validation of the XML file ?
Any other suggestion?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]