Re: [xsl] Best approach for writing an XML log whilst processing/writing other XML documents?

Subject: Re: [xsl] Best approach for writing an XML log whilst processing/writing other XML documents?
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Fri, 13 Aug 2010 14:35:55 +0100
> Now comes the problem.  As I do this processing, I need to collect
> some information that allow me to report on the process,
...
> Unfortunately, I cannot find a way to generate the 2 in parallel (ie.
> the copies of original files and the report), since creation of new
> nodes in the mode='replace' templates would obviously go into the
> copied files, not the report.
> The only way I can think of doing is in a 2-pass algorithm, first
> doing all the copying (more=replace), then going through it all again
> and produce the report (mode=report), but I hope there is another way
> (particularly one that avoids having to go through all dependency
> files twice)

There are a few ways, the usual is to use xsl:message to output the
information as rootless xml, then hand-convert that afterwards into
well-formed XML and then process that.

Alternatively, you may be able to add the information to your result
documents (say in your own namespace) and post-process those files to
extract it, then use a final pass to remove it  (if needed).


--
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

Current Thread