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

Re: document() function - friendly error message when

Subject: Re: document() function - friendly error message when load fails
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Mon, 15 Jan 2007 15:49:20 +0100
ovidiu cotarlea
Hi Ovidiu,

What a coincidence: for the past few days we happen to have being discussing this very thing (though, more generic, about URI escaping and wrong URI references), see More meaningful error for "Fatal error during transformation: null" on the Saxon list.

Alas, that is about XSLT 2. You use MSXML, thus limited to XSLT 1. And XSLT 1 does not provide such function (nor does XPath 1 for that matter).

You can use msxsl:script, I suppose. If it supports normal JavaScript of VBScript (I never used msxml), I reckon you can employ the XMLHttpRequest object to try to load the file. If it returns a 404 (or any 4xx error), it is not there and you can act accordingly. Note, however, that this requires two times requesting the file: 1x for the XHR, and 1x for XSLT document().

Cheers,
-- Abel Braaksma
  http://www.nuntia.nl

Ovidiu Cotarlea wrote:
1. Hi, Is there any way to catch the error that the
xslt function document() it's throwing when the resource specified
by the uri is not found?
My XML is rendered into HTML directly by Internet
Explorer 6 (MSXML 3.0).
It seems that the MSXML 3.0 in this case is not
returnig an empty node-set and it prefers the error message.


2. Did anyone tried to use <msxsl:script> </msxsl:script> to check if the resource is available?

Thanks,
Coti





___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

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.