Re: [xml] xmlTextReader API and external DTD validation



On Wed, Jul 07, 2004 at 09:40:05PM -0700, R. P. wrote:
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.

  I think it's the second time it is requested. It's not very difficult
but not trivial either. Basially this would require:
  - An API addition to set up the DTD (URI) in the reader
    context
  - call the parsing of the DTD and error handling
  - Some control over the Read() operation to free up the actual
    DTD when read and plug the one preparsed from the context
  - cleanup when the context is reset or discarded.

DTD with an identical external DTD on my local system.  Right now I
don't find any way doing this with the TextReader API.

  Right this is not possible now.

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

  This really require new code,

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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