I am trying to use VBSctipt to do an xslt transform on an xml object.
The xsl file I'm translating includes the <xsl:import href="script.xsl"/>
directive. If I use the absolute href (http://localhost/mysite/script.xsl) it imports the style sheet fine; however, if I use the relative path (script.xsl) it reports "resource not found". I need to be able to port this amongst a set of machines, so I need to be able to use the relative uri. Any suggestions?
notes:
- VBscript file is at http://localhost/myscript.asp
- first xsl file is at http://localhost/mysite/styles.xsl
- second xsl file is at http://localhost/mysite/script.xsl
- using the relative path mysite/script.xsl also does not work.
Addendum:
Thanks everyone for their answers but the more I dig into the code that is doing this, the stranger it is. myscript.asp is a rather unusual compilation of code. What happens is styles.xsl is included in the html output of myscript.asp as a xml chunk (<xml src=...>
) and then that chunk is loaded as a stylesheet, using vbscript, on the client side. This stylesheet is then used to transform
a xml chunk that is retrieved via xmlhttp. So the problem is the context of styles.xsl is the html on the client side and has no relation to where script.xsl is.