xsl-list
[Top] [All Lists]

RE: [xsl] Debugging XSL using Saxon

2006-06-16 11:29:28
Alternatively you can simply use xsl:message or the trace() function.
(Sometimes rather than xsl:message I use xsl:comment, which 
inserts the
diagnostic output into the result document).

The drawback with xsl:message is what to do with them after debugging.

What I've started to do is use a global debug parameter that can be
checked so your debugging xsl:messages can be turned on or off when
needed.  For example:

  <xsl:if test="$debug > 0">
    <xsl:message>...</xsl:message>
  </xsl:if>

The parameter is an integer.  You can conditionalize your statements
to only print out if $debug is set to a larger number, allowing
different levels of debugging output.

Have the default value for $debug be 0 and then you can override
it on the command-line when debugging is needed.

I'm not sure if this is good style, but it works for me.  If there
are better options, please pass them along.

--ewh
-- 
Earl Hood
Software Engineer
HP/ATCL
earl(_dot_)hood(_at_)hp(_dot_)com 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>