Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] document() function and error-handling

From: Robert Koberg <rob@---------->
To:
Date: 1/3/2008 5:07:00 PM
I will assume this is in a web environment. You could configure your web
app/server to return a well-formed error page when you get a 404 (and
disregard it if you want).

best,
-Rob


On Thu, 2008-01-03 at 10:49 -0600, Scott Trenda wrote:
> Quick question, might be specific to the MSXML XSLT processor.
> 
> I'm trying to reference two different files passed in as parameters to a transformation using the document() function. If the files are blank or valid URIs (the URI handling is correct), the transformation works as expected, but if the URI points to a non-existant file, MSXML errors out with code 0x800c0006: "The system cannot locate the object specified." I'm developing a central framework for several different applications, and I don't know if the application is actually going to create the file I'm trying to reference here. If it doesn't exist, I don't care, I just want to use it in the case that it does exist.
> 
> I've played around with some different scenarios in the stylesheet, and the error occurs any time I try to access the variable that contains the result of the document() function, even if I only want to check if it's non-empty. Is there any more graceful way (for MSXML, in particular) to handle the case where the URI passed to document() doesn't exist?
> 
> I've included the stylesheet I'm using at the bottom, just in case it helps.
> 
> ~ Scott


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent