[xsl] How to produce a record of changes made in an identity transform?

Subject: [xsl] How to produce a record of changes made in an identity transform?
From: munna@xxxxxxxxxx
Date: Wed, 28 Jul 2004 06:13:40 -0500
Hello all,
I had posted this query yesterday, but realised that the subject of the message didn't quite clarify my question, hence this repost. Apologies to those who have already seen this message.
Here's my problem:
I have the following stylesheet which essentially performs an identity transform on a given xml instance, producing a copy with
only slight changes (the e.g. below has one of these -- stripping out the concluding punctuation from element 'onlyNum' -- but the actual stylesheet will have more). I would like to produce another document that records these changes, at least as a list containing the original and changed node. this can be either text or xml, something on the lines of:
<onlyNum>E345.</onlyNum> changed to
I have a feeling this could be done with xsl:result-document, but am not sure how to proceed. Any suggestions would be most welcome. 

Thanks in advance,


<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:output method="xml" indent="no"

<xsl:template match="/|@*|node()">
<xsl:apply-templates select="@*|node()"/>

<xsl:template match="onlyNum">
		<xsl:analyze-string select="."
regex="^(\w+)(\s)*([.])(\s)*$" flags="m">
				<xsl:value-of select="regex-group(1)" />


Sign-up for Ads Free at Mail.com

Current Thread