Re: [xsl] Mulitple error messagees.

Subject: Re: [xsl] Mulitple error messagees.
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 5 Feb 2002 07:17:04 +0000
Hi Raj,

> In my xsl, I have a error template which will be called from many
> templates whenever there is an error. At the end of the xsl, I want
> to return that error message to the clinet. My problem here is, how
> can I store all the error messages with in the error template, which
> has been called more than once from other templates.

You can't store things up in XSLT - that's just not the way that it
works. If you want to create a collection of error messages at the end
of the main result then you have to create the error messages after
you've created the rest of the result. You could have one set of
templates that dealt with creating the main result, and another set of
templates (in error mode) that dealt with creating the error messages.
Then you could get the overall result that you were after with:

<xsl:template match="/">
  <xsl:apply-templates />
  <xsl:apply-templates mode="error" />
</xsl:template>

The templates in error mode could then call your ERROR template, which
could generate some text (or whatever) in the result for the error.

Alternatively, you could use xsl:message to send the error messages to
the processor, which should then send them to stderr or to a pop-up
message box or something.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread