xsl-list
[Top] [All Lists]

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

2010-08-13 08:36:04
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/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--