XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
(Deleted User) Subject: want an example showing error or exception handling in XSLT 2.0 using xalan processor
Author: (Deleted User)
Date: 03 Jul 2007 04:26 AM
Originally Posted: 03 Jul 2007 04:25 AM
hi,

i want an example showing error handling in XSLT 2.0 using xalan processor.

can anyone check it out once.


Regards,
yasodhar.

Postnext
Alberto MassariSubject: want an example showing error or exception handling in XSLT 2.0 using xalan processor
Author: Alberto Massari
Date: 03 Jul 2007 08:09 AM
Originally Posted: 03 Jul 2007 08:10 AM
Hi yasodhar,
Xalan doesn't support XSLT 2.0, only Saxon does. Given that the XSLT 2.0 specs doesn't define a way to recover from dynamic errors, Saxon-SA does it through an extension function, saxon:try (see http://www.saxonica.com/documentation/extensions/functions/try.html)

Hope this helps,
Alberto

Postnext
(Deleted User) Subject: i want an example showing error or exception handling in XSLT 2.0 using xalan processor
Author: (Deleted User)
Date: 03 Jul 2007 08:26 AM
Originally Posted: 03 Jul 2007 08:24 AM
hi Alberto,

i will be using xalan processor only. you mean to say that error handling is not possible, if i use xalan processor or what? can you be little bit clear. if so can you explain me why is it so? what is saxon? as per my knowledge its another processor. am i right?

Regards,
yasodhar.

Postnext
Alberto MassariSubject: Re: i want an example showing error or exception handling in XSLT 2.0 using xalan processor
Author: Alberto Massari
Date: 03 Jul 2007 08:48 AM
Hi yasodhar,
you stated you wanted to use Xalan with an XSLT 2.0 stylesheet, but
Xalan only supports the XSLT 1.0 specs (see
http://xml.apache.org/xalan-j/index.html).
If you want to use instructions defined in the XSLT 2.0 specs, you
will have to use the Saxon processor from Saxonica, that also
supports the error handling that you want to use (if I understood it right)
Even if you don't need XSLT 2.0, I think that Xalan doesn't provide
any facility to trap errors from inside the stylesheet, but I may be
wrong, so try looking at the Xalan mailing list
(http://marc.info/?l=xalan-j-users)

Hope this helps,
Alberto

Postnext
(Deleted User) Subject: Re: i want an example showing error or exception handling in XSLT 2.0 using xalan processor
Author: (Deleted User)
Date: 03 Jul 2007 09:36 AM
Hi Alberto

My project involves converting incoming source XMLs into UDM formats (generic domain specific xmls). I have been advised to use XALAN with XSLT 2.0 for transforming incoming XMLs to UDM. However you are correct that XALAN does not support XSLT 2.0 as given on apache site.

One more doubt which I had is, if I plan to use XSLT 1.0 with XALAN then I did not get what you mean to say

"Xalan doesn't provide any facility to trap errors from inside the stylesheet"

I assume that that you are saying if incoming XML does not match the intended XSD then XSLT transformation will fail and XALAN will not be in position to explain what the exact error is.

I am pretty new to XSLT, please bear me.

Thanks again.

Regards,
Yesodhar

Postnext
Alberto MassariSubject: Re: i want an example showing error or exception handling in XSLT 2.0 using xalan processor
Author: Alberto Massari
Date: 03 Jul 2007 10:33 AM
Hi Yesodhar,
when you talk about error and exception handling in XSLT 2, I
immediately think that you want to recover from an error without
killing the transformation process; but if what you really need is to
have a description of the reason why the transformation process
failed, you should be able to retrieve it from the Java exception
that the processor throws in those cases.

Alberto

Postnext
(Deleted User) Subject: Re: i want an example showing error or exception handling in XSLT 2.0 using xalan processor
Author: (Deleted User)
Date: 03 Jul 2007 11:05 AM
hi Alberto,

i got it what you said. Thanx for that.

1. if i use xslt 1.0 for transformation instead of xslt 2.0 is there any problem. i mean to say that are there any major updates between two version. if so let me know what are they.

2. how to handle exceptions in xslt 1.0? is it require to handle exceptions while transformations is done? what are the type of exceptions available like other than static and dynamic? can u differentiate me when to use which type of exception?

Regards,
yasodhar.



Posttop
Alberto MassariSubject: Re: i want an example showing error or exception handling in XSLT 2.0 using xalan processor
Author: Alberto Massari
Date: 03 Jul 2007 11:27 AM
Hi yasodhar,
the difference between XSLT 2.0 and XSLT 1.0 is large, from the type
system (XSLT 2.0 understands XMLSchema and all the data types it
defines) to the function library (XSLT 2.0 defines more than 100
built-in functions) to the new instructions to perform grouping and
access text files. Whether you need XSLT 2.0 vs XSLT 1.0 depends on
what you need to do; in some cases you can achieve the same result in
XSLT 1.0 by using external Java functions.
As for handling errors in XSLT 1.0, if you invoke the XSLT processor
from Java code, you simply need to catch java.lang.Exception and you
are done. But have a look at the documentation at
http://xml.apache.org/xalan-j/usagepatterns.html, it should cover
also your case.

Alberto

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.