RE: [xsl] [XSLT 2] rescue

Subject: RE: [xsl] [XSLT 2] rescue
From: "Varley, Roger" <Roger.Varley@xxxxxxxxxxx>
Date: Tue, 17 Jun 2003 16:33:30 +0100
> If my XSLT application, running without supervision (eg on 
> the server), 
> gets fed a document which references a non-existent file, then my 
> application must be able to deal with that; It is 
> unacceptable to abort 
> the whole transformation. Since I'm not aware of any 
> facilities to test 
> for the existence of files (validity of paths/URIs), I need a way to 
> recover from the currently unfortunately fatal error raised after a 
> failed unparsed-text().
> 

Delegate the decision. I solved this by removing any direct reference to a
path and instead referenced a servlet in the document() function passing the
path as a parameter. The servlet becomes responsible for opening the
resource and passing the XML back in the HttpOutputStream. If the resource
cannot be found, the servlet returns a valid, but empty XML file.

Regards
Roger

 

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


Current Thread