xsl-list
[Top] [All Lists]

RE: [XSLT 2] rescue

2003-06-15 13:10:49
Unfortunately there is no try-catch in XPath 2 or XSLT 2.

We debated putting one in, but people felt it was a bridge too far.
People were particularly concerned about defining exactly what state the
system was in if an error was trapped and ignored, for example, should
it effectively be required to do a "rollback" of the result tree.

Michael Kay


-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Tobias Reif
Sent: 14 June 2003 17:28
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] [XSLT 2] rescue


Hi

In Ruby I can do

   begin
     # do something
   rescue
     # do something else if the above failed
   end

How to do that in XSLT 2? (or XPath 2)

For example when the path in unparsed-text($path) does not 
point to anything, I'd like to print a message and generate a 
comment, and I want the transformation to be continued, not aborted.

Tobi

-- 
http://www.pinkjuice.com/


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



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



<Prev in Thread] Current Thread [Next in Thread>