Re: [xml] xmlReader: Possibility for cloning an xmlTextReader (or multi-pass reading)

On Sat, 2013-03-30 at 08:02 +0100, Martin B. wrote:
It turns out however, that the subtree where the large data resides has 
to be read not in-order, but I have to collect some (small amount of) 
data before the other. 
Do you process the file only once, or many times, between times when it

If you process the large file multiple times, and you have to
re-engineer the code, you could consider something like dbxml, which
will parse the document once and can make an index; subsequence accesses
can be fairly fast because there's no need to read the file.

If you process the large file at most once every time it changes, using
an XQery engine like dbxml isn't so obvious a win: it can still help
with the out-of-order access in some cases, but the gains might not be
worth the engineering effort of reworking your code.

As Daniel has said, libxml is pretty fast at parsing, so another
strategy might be fetching only the parts you need into a new, smaller
XML document and then using XSLT.


Liam Quin - XML Activity Lead, W3C,
Pictures from old books:
Ankh: freenode/#xml

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