I'm assuming you'd rather use XSLT so "just use perl" isn't so useful
an answer.
On Tuesday, April 8, 2003, at 12:05 PM, Peter Binkley wrote:
but I gather from a posting by Michael Kay
(http://www.biglist.com/lists/xsl-list/archives/200212/msg00507.html)
that
all of those document() source trees are remaining in memory
throughout the
transformation, adding up to megabytes of data.
Since document() trees are source trees it would seem as though the
easy answer is that they must remain in memory. However I wonder what
would happen if you only call the document() inside of a variable?
Perhaps when the variable passes out of scope the document() source
tree will be dumped. Maybe
Can anyone suggest a strategy? The process doesn't have to be fast, it
just
has to finish.
Using XSLT? You might try another parser just to see what happens. But
given the limitations of the language, it may not be possible. It all
depends on whether or not there is a /correct/ way of loading a
document() source tree only inside a certain scope, and if there is,
asking one of the parser authors to implement that.
Otherwise you could write a simple shell in another language that loops
over the file and calls the XSLT with a parameter on the command-line
that contains the name of a single file.
If you're on unix though you really should look at
man wc
That will give you the counts you need ... again these could be passed
in as parameters on the command line and picked up in the XSLT to
simply add them into the output tree without needing to count the words
in XSLT.
simon
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list