Re: [xsl] how to get node names to user when using redirect

Subject: Re: [xsl] how to get node names to user when using redirect
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 12 Feb 2004 12:29:02 -0500
At 2004-02-12 17:56 +0100, Mikael Petterson (KI/EAB) wrote:
I am using xsl to create a number of java files. If I discover a certain
information in my input file (xml) I must report it to the user similair to
" Error reported when creating class "AAA". However when I am generating I
use redirect to write to files.
This means that my error message will go in the java file. Not so good. User
will get no info which class is going wrong.
I was thinking of using the
<xsl:message terminate="yes">
Error: creating class .....
But I cannot (or I do not lknow) get my class value into the message-tag. I
need to pinpoint
my class otherwise it is no use to the user.

It is a simple text string composed as you would a text node for the result tree ... so you have the whole of XSLT/XPath with which to create the text:

  <xsl:message terminate="yes">
    Error: creating class <xsl:value-of select="path-to-class-name-here"/>

... or some such message as you would like your users to see.

I hope this helps.

................... Ken

-- Public courses: upcoming world tour of hands-on XSL training events Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO Washington, DC: 2004-03-15 San Francisco, CA: 2004-03-22 Hong Kong: 2004-05-17 Germany: 2004-05-24 England: 2004-06-07 World-wide on-site corporate, government & user group XML training!

G. Ken Holman                  mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd. 
Box 266, Kars, Ontario CANADA K0A-2E0     +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness

XSL-List info and archive:

Current Thread