Within my ASP.NET application, I'm loading an XML file into an XSLT with the document()
method, as follows:
<xsl:variable name="more-xml" select="document('generateXml.ashx')" />
This works fine when I run it locally, but fails when I deploy it to the server because the server finds generateXml.ashx
through the file system, so it isn't processed by IIS.
If I hard-code the URL like this:
<xsl:variable name="more-xml" select="document('http://server/app/generateXml.ashx')" />
Then the document address is always resolved over HTTP, so it works consistently - but I don't want to hard-code the URL into the XSLT. Is there a way to force document() to use HTTP instead of FILE for a relative path?