[Mod-xml-general] The realloc question
Status: Inactive
Brought to you by:
nrkew
From: Nick K. <ni...@we...> - 2002-05-15 23:43:24
|
On Tue, 7 May 2002, Philipp Dunkel wrote: > 3rd I have no idea what you are talking about with the callback concept. The > problem remains that before parsing transforming I need the entire document > in one buffer, otherwise I won't get a DOM-like structure that I can pass to > the tranformation. What I had in mind was to build the Doctree using a progressive parse, as the mod_xml main handler does (if you select a DOM parser). This avoids the thorny realloc/or equivalent problem. I have not managed to do that for XSLT. However, I have come to the view that the realloc has to go, so I've updated mod_xml to do: (1) If Content-length is set, we use that to alloc a memory buffer in one. (2) If Content-Length is not available, we use a tempfile. A possible future enhancement would be to allow this choice to be controlled by configuration options, though I'd still prefer a progressive parse. To accompany that, we have a couple of optimisations: (3) If the main parser is used, it can pass a doctree to the XSLT filter, which will then omit the parse altogether (4) (not yet done) A main handler for static XML docs, that will shortcircuit the normal process and have the XSLT parser read the XML doc in the manner of a main handler. I have not yet checked in this lot, but since it addresses one important issue we've been debating I thought it worth running by you! Regards, -- Nick Kew |