Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Check if file exists from inside XSL

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 9/5/2005 1:11:00 PM

Darren Clark wrote:

> Is it possible to check if a file exists from inside of XSL?
> 
> e.g. if the XML that i am styling passing in a image name and path, Can i 
> call out to any .NET methods to check if a file exists?

XSLT 1.0 only has the function named document to load additional XML 
data, there is nothing to check the existance of any file on the local 
file system or to check the HTTP status of a URL on a HTTP server.

What you can do however is set up some HTTP server application using 
e.g. PHP or JSP or ASP.NET that checks file existance or HTTP status, 
returns the results in XML format and then the stylesheet could use
   document('http://example.com/urlchecker.php?url=someURLToCheckHere')
for instance.

Or within the .NET XSLT processor you have two ways to extend the 
functionality, you can use extension objects or you can use script in 
the stylesheet. Details on these approaches are here:
<http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/02/03/xml/toc.asp>

Both way you can use the classes available in the .NET framework to 
solve the task you want and use the result in the stylesheet.

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


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