[xsl] catching Java exceptions in saxon?

Subject: [xsl] catching Java exceptions in saxon?
From: Gunther Schadow <gunther@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 17 Apr 2002 21:28:09 -0500
Hi Mike,

ah, I can't stop praising saxon. You've done such a fine job!
XSLT with saxon has become my bread-and-butter scripting language.
Can't imagine the days any more where the level of debugging help
was the message "the parameter is incorrect" :-)

I have a few questions or suggestions:

I am using the Java extensibility a lot, it works wonderfully.
It would be even nicer if XPath would be augmented so as to
allow object oriented "dot" notation. I would say

<xsl:variable name="magic" select="$thing.getMagic()"/>

and it would call the getMagic() method on the object refered
to by the XSLT variable $thing. This would not be hard to
implement in saxon, because it's a java engine by itself.
Did you consider that? Sounds to me like a worthwhile extension
of the XSLT/Xpath specification too.

The other thing is, couldn't there be an exception handling
block in XSLT/saxon. For instance:

<xsl:template ...>
  <saxon:try>
     <fortune>
       <xsl:value-of select="magic:get-fortune($magic)"/>
     </fortune>
     <saxon:catch exception="java:FortuneNotFoundException()">
        <sorry>
          <no-luck-today/>
        </sorry>
     </saxon:catch>
  </saxon:try>
</xsl:template>

Or something along those lines.

What do you think?

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


Current Thread