Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Check if file exists from inside XSL [Thread Next] Re: Check if file exists from inside XSLTo: 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/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
