Re: [xml] using DTD from memory



On Tue, Oct 12, 2004 at 05:39:52PM +0200, Volker Roth wrote:
Hello all,

we have the following problem:
1. we have many xml files on disc.
2. the xml files contain entities stored in the dtd
3. we want to parse, validate and default
   attribute them all with the same very large dtd
   (about 100.000 lines)

question:
is it possible to use the dtd from memory 
in order to avoid repeated reading from disk

if yes, tell us please how 
to do so.

  Not easilly, you will have to do some hacking.
First this won't work purely at a SAX level, if you
build the tree it should be doable by hacking the 
start and end Document callbacks in the SAX parser to
link the preparsed DTD and remove it at the end. You
will also probably want entity replacemnt to be activated to
avoid stale links to the DTD from the tree.
  Very hackish but doable IMHO.

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]