[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How to produce a record of changes made in an ide

Subject: Re: How to produce a record of changes made in an identity transform?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 28 Jul 2004 12:24:36 +0100
how to produce a record
This is really like a table of contents, so the canonical way of
proceeding is to process the document twice, with two modes
so

<xsl:template match="/">
 <xsl:apply-templates/>
<xsl:result-document ....>
 <xsl:apply-templates mode="log"/>
</xsl:result document>
</xsl:template>

You then just duplicate every 
<xsl:template match="something">
that's doing something otherthan an identity and have
<xsl:template match="something" mode=log">
 I did something
</xsl:template>

If reprocessing the document twice and duplicating the templates doesn't
feel right then an alternative plan (which isn't really following the
one-true-path to functional programming purity is to stick an 
<xsl:message>
I did something
</xsl:message>
into any template that does anything, then use your command line or API
to redirect the xsl:message output to your log file.

Note however that the first way is guaranteed to produce the log in a
logical order, the second way will most likely produce the log in the
order that the system actually evaluated the templates, which if you
have some (perhaps mythical) highly parralelised and optimised xslt
engine mightbe in any order at all.

David


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.