[xml] xmlTextReader API and external DTD validation



I am new to both XML and to the libxml2 API but using the code examples
included in the source I was able to figure out that in order to
minimize memory requirements, I needed to use the new xmlTextReader API
for parsing and validation, just as the tutorial chapter "Introduction:
why a new API" suggests.  Well, my test code works fine for parsing and
validating with the included (DOCTYPE) DTD file, but I could not figure
out how to "tell" the TextReader API to use an external DTD in place of
the internal one.  Pouring over the xmllint code to see how
the --dtdvalid option is handled, did not help either, as it does not
use the TextReader API for it.  It just occured to me that adding the
extra code to override the use of internal DTD with an external one
should not involve too much extra coding and would add a great deal of
usability to the fast and memory saving TextReader API.

In my case I have to generate rather large xml files on one system which
then will be used on another system.  I have to write the full path name
of the internal DTD in the DOCTYPE line but that path name is valid only
on that other, target system, not on mine, where I generate it.  After
creating this XML file I need to parse/validate it on my system before
ftp-ing it to the other, but for the above reason I cannot use the
internal DTD for validation.  Instead, I need to override the internal
DTD with an identical external DTD on my local system.  Right now I
don't find any way doing this with the TextReader API.

Any chance of having this capability added to the TextReader API, or
there is already some workaround for this I am not aware of?

Thanks,
Rudy




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