Re: [xml] external DTD validation of large XML's



Jon <jon forums gmail com> writes:

In many cases you don't even need that. Write a shell XML file,

<!DOCTYPE wrapper SYSTEM "the-dtd-file.dtd" [
  <!ELEMENT wrapper the-real-root-element>
  <!ENTITY the-real-document SYSTEM "bigfile.xml">
]>
<wrapper>&the-real-document;</wrapper>

Will the libxml2 implementation try to bring the entire &the-real-document; entity into memory, or will it 
stream it if I use the SAX2 or Reader API?  My gut tells me both the dtd and the bigfile.xml will be 
completely parsed into memory. This is fine for the dtd but not for the bigfile.xml.

A reading of xmlParseReference suggests your gut is wrong. :)

http://git.gnome.org/browse/libxml2/tree/parser.c#n6823



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