[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSLT exception handling, HTTP/POST and more ... (updat

Subject: XSLT exception handling, HTTP/POST and more ... (update)
From: Gunther Schadow <gunther@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 05 Dec 2002 16:59:28 -0500
xslt exception
Hi,

regarding my Saxon extensions for exception handling and HTTP/POST
interactions, I have now created a project on source forge. It's
called the XSLT Web Services Framework (XWSF) [http://sourceforge.net/projects/xwsf]. Right now it comes with
a little Servlet that will run the request message against an XSLT
transform to produce the response message. There is a rudimentary
SOAP adapter that handles the SOAP overhead so that the specific
transforms only need to do contain the stuff that deals with the SOAP
body.


The exception and post:message extensions are available for server
and client XSLTs. Some demos are included that show how ridiculously
simple it is to call web services from XSLT.

I made no release yet, just CVS, but feel free to grab it through
CVS. The code is actually usable, but the build and deployment
process is still largely manual. If someone is insterested in helping
with this code for the Xalan side of the world, please drop a note.

Michael Kay has noted that one problem of exception catching is:
what do you do with the partially generated output tree? Well,
I fixed this issue now: the xsl:try block buffers the generated
tree and only outputs it when the ex:try block was successful.
This works nicely for small try blocks now. But if the try
block produces huge amounts of data (e.g., a batch of thousands
of documents) it runs out of memory. So, I have added a switch
to ex:try where you can say <ex:try atomic="no"> and then it
will output directly. I do nest atomic try blocks in non-atomic
ones when generating a node sequence, to be sure never to
generate a parial node, but allow a sequence to be truncated in
case of an exception. E.g.,

<list>

<ex:try atomic="no">

<xsl:for-each ...>

<ex:try atomic="yes">

<xsl:apply-templates mode="createthisnode"/>

        <ex:catch exception="java.lang.Throwable">
          <exception msg="{ex:current-exception()}">
             The node causing this exception was not output because
	     it was incomplete!
          </exception>
          <ex:throw select="ne:new()" xmlns:ne="java:my.NodeError"/>
        <ex:catch>

</ex:try>

</xsl:for-each>

    <ex:catch exception="java.lang.Throwable">
      <exception msg="{ex:current-exception()}">
         The list was truncated because an exception occurred.
      </exception>
    <ex:catch>

</ex:try>

</list>


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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.