Are there drawbacks to setting up a catalog file to an dummy dtd when transforming XML using XSLT

63 views Asked by At

Setting up a catalog file to point an empty file to serve as the DTD of an XML file with a DOCTYPE-declaration can work fine. But are there any drawbacks for the Saxon engine? Would processing the XML be more efficient if a copy of the right DTD was made locally available? Or would that depend on the (complexity/simplicity) of the XLST at hand? (Assuming in the latter situation that the XML is valid against the supplied DTD)

2

There are 2 answers

0
Michael Kay On BEST ANSWER

Obviously if the document contains entity references then parsing may fail if these are not present in the DTD. Otherwise, if you're not validating, and don't care about ID attributes, then the DTD serves no useful purpose, and a dummy will work just as well.

0
imhotap On

In addition to what Michael said, another issue I can see is when your DTD uses defaulted or #FIXED attribute declarations, then those default attribute values will be considered part of your input document graph only if the regular DTD rather than an empty one is used.