Re: [xslt] Working with lots of XML files



Bernhard Zwischenbrugger wrote:
[..]
> The stylesheet is easy made:
> 
> <xsl:for-each select="/all/item">
> <xsl:apply-templates select="exsl:node-set(document(@file))" mode="makesum"/>
> </xsl:for-each>
> 
> <xsl:template match="*" mode="makesum">
> ....
> make sum
> ...
> </xsl:template>
> 
> -----------------
> 
> The problem I have, is that xsltproc at the moment needs about 200MB Ram to 
> process 
> this and the list of XML Files will grow maybe up to 10000 in the next
> years.

I've been getting in the habit of using a hybrid of xslt + DOM manipulation
(whatever binding you like; Python, Perl's XML::LibXML), whenver the XSL
would get too `nasty'.   Here you're xsl is simple enough, but ...

Anyway, have you considered computing the sum in some other language?
Loop over the files, for each file:
  read it in, compute partial sum, then the doc gets freed.
It would be essentially as simple as your stylesheet, providing it
fits into your `pipeline'...



-- 
bruce.miller@nist.gov
http://math.nist.gov/~BMiller/




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