[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Java exception handling in XSLT is possible (and darn
Hi, I have code I'm willing to share. This code implements Java exception handling in XSLT for Saxon and Saxon v7. Here is an example (given the namespace prefix "ex" is define with the URL http://regenstrief.org/org.regenstrief.saxon7.ExceptionElementFactory the thing works as follows: <ex:try> <!-- do something that could fail --> <ex:catch exception="java.lang.NullPointerException"> <xsl:message terminate="no"> <WARNING exception="{ex:current-exception()}"/> </xsl:message> </ex:catch> <ex:catch exception="my.package.ReallyBadException"> <ex:throw select="ex:current-exception()"/> <ex:catch> <ex:try> and you can have more ex:catch blocks inside the ex:try element to get particular types of exceptions (specified as java fully qualified class names in ex:catch/@exception attribute. If you want to use this code, please respond to the list in public (I want a public show of hands.) I am glad to share the code, but I would prefer to integrate it into Saxon or any other XSLT package (I suppose it's quite easy to transfer into Xalan -- just haven't had the time to worry about Xalan and it's internals) instead of a free-floating snippet. best regards, -Gunther -- Gunther Schadow, M.D., Ph.D. gschadow@xxxxxxxxxxxxxxx Medical Information Scientist Regenstrief Institute for Health Care Adjunct Assistant Professor Indiana University School of Medicine tel:1(317)630-7960 http://aurora.regenstrief.org XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|