Re: [xsl] user error

Subject: Re: [xsl] user error
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 10 Sep 2009 11:41:47 -0700
At 2009-09-10 14:00 -0400, Mike Sokolov wrote:
Is there a recognized idiom for throwing an exception in XSLT that would abort processing and pass the error state (message, at least) to the invoker of the transformation?
It looks to me as if this can be achieved using the XPath error() function, but I'm just wondering how folks would typically invoke that.
Using <xsl:value-of select="error()" /> seems like the most unobtrusive, but I wonder if there is some built-in XSLTism for this.

Review <xsl:message terminate="yes"> for what you need.


I hope this helps.

. . . . . . . . . Ken


-- Interested in these classes? http://www.CraneSoftwrights.com/s/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread