Thanks! That's exactly what I was looking for. I like the syntax
better than the XPath version, although it's also worth noting the
differences between the output generated by the two methods. Using
Saxon, at least: the XPath error() generates a stack trace, which may be
helpful, wheras xslt:message seems to rely on the stylesheet writer to
generate whatever contextual info is required.
-Mike
G. Ken Holman wrote:
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(_at_)CraneSoftwrights(_dot_)com
Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers: http://www.CraneSoftwrights.com/legal
--~------------------------------------------------------------------
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>
--~--
--~------------------------------------------------------------------
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>
--~--