|
[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
Munna,
One way of approaching this is to provide your output not only with the near-copy of your input, but to "annotate" it with elements (probably in a separate namespace) logging the changes made. Then in a separate pass (or two of them) you filter the result into two -- one that contains just the transform results you wanted, another that contains your change log. In XSLT 2.0, all these traversals can be accomplished in a single run of the stylesheet. So:
<xsl:template match="onlyNum">
<xsl:variable name="result">
<onlyNum>
<xsl:analyze-string select="." regex="^(\w+)(\s)*([.])(\s)*$" flags="m">
<xsl:matching-substring>
<xsl:value-of select="regex-group(1)" />
</xsl:matching-substring>
</xsl:analyze-string>
</onlyNum>
</xsl:variable>
<xsl:copy-of select="$result"/>
<log:change xmlns:log="yournamespaceURI">
<xsl:copy-of select="."/>
<xsl:text> changed to </xsl:text>
<xsl:copy-of select="$result"/>
</log:change>
</xsl:template>This approach was first suggested to me by my boss, Tommie Usdin ("XSL-List Owner" to all y'all). Of course, it can be applied to any transform, not just near-copies. Cheers, Wendell At 07:13 AM 7/28/2004, you wrote: Hello all, ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








