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

Re: xsl self-documentation - trace

Subject: Re: xsl self-documentation - trace
From: Warren Hedley <w.hedley@xxxxxxxxxxxxxx>
Date: Thu, 29 Jun 2000 09:43:43 -0400
trace warren
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}]&#xA;'" />
      <oxsl:value-of select="concat('  current node = [', name(), ']&#xA;')" />
      <xsl:for-each select="xsl:param">
        <oxsl:value-of select="concat('  parameter [{@name}]=[',
            ${@name}, ']&#xA;')" />
      </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


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.