This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl self-documentation - trace
- To: xsl-list at mulberrytech dot com
- Subject: Re: xsl self-documentation - trace
- From: Warren Hedley <w dot hedley at auckland dot ac dot nz>
- Date: Thu, 29 Jun 2000 09:43:43 -0400
- Organization: Department of Engineering Science, The University of Auckland
- References: <03431173307093@mail.nls.net>
- Reply-To: xsl-list at mulberrytech dot com
Randall Parker wrote:
>
> 1) A listing file.
> The listing file would be the XSLT document that it processed but with a twist: Every line (or maybe every test) would be numbered.
>
> 2) A numbered match history.
Just ignoring the numbers for a moment.
I was thinking last night that it would be possible to write a
stylesheet that when applied to a stylesheet, generates a "debug"
version of that stylesheet which contains <xsl:message> elements
which print out things like template calls and parameters
received. I'm sure it can be done but I'd hate to have to deal with
all of the namespace bollox.
Here's the kind of code that you might use for named templates -
definitely not tested. Let's say that we use oxsl as the output
XSL namespace, and use namespace-alias for the switch.
<xsl:template match="xsl:template[@name]">
<xsl:copy>
<xsl:copy-of select="@*" />
<xsl:copy-of select="xsl:param" />
<oxsl:message>
<oxsl:value-of select="'Entering template [{@name}]
'" />
<oxsl:value-of select="concat(' current node = [', name(), ']
')" />
<xsl:for-each select="xsl:param">
<oxsl:value-of select="concat(' parameter [{@name}]=[',
${@name}, ']
')" />
</xsl:for-each>
</oxsl:message>
<xsl:copy-of select="*[not(self::xsl:param)]" />
</xsl:copy>
</xsl:template>
--
Warren Hedley
Department of Engineering Science
Auckland University
New Zealand
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list