The way to access variables of the kind can be done like this.
[1] Embed a class to interface the variables on the asp page with the xsl document. It is inside the <% ... %> to begin with.
[tt]
<%
'something else
class asp_xsl
public function getgvar(x)
getgvar=eval(x)
end function
end class
'some other thing such as myVar
dim myVar
myVar="frak"
'etc etc
'such as the algorithm of xml and transformation like [3]
'etc etc
%>
[/tt]
[2] Then you script the xsl source file like this with a namespace (arbitrary) extension.
[tt]
<xsl:stylesheet version="1.0" xmlns:xsl="
[blue]xmlns:aspxsl="urn:asp-xsl-interfacing"[/blue]>
<!-- etc etc -->
<span>
<xsl:value-of select="aspxsl:getgvar('myVar')" />
</span>
<!-- etc etc -->
</xsl:stylesheet>
[/tt]
[3] Again back to the asp page. Inside the <% ... %> where you instantiate processors (xml parser and xsl processor), you use addobject method to attach the class to the xsl processor.
[tt]
set xslt=createobject("msxml2.xsltemplate.3.0")
set xslDoc=createobject("msxml2.freethreadeddomdocument.3.0")
set xmlDoc=createobject("msxml2.domdocument.3.0")
'etc etc including loading xml, xsl... with error handling ignored here
xslDoc.asyn=false
xslDoc.load path_to_xsl.xsl
'error handling
set xslt.stylesheet=xslDoc
xmlDoc.asyn=false
xmlDoc.load path_to_xml.xml
'error handling
set xslProc=xslt.createprocessor()
xslProc.input=xmlDoc
'this depends on how to use the transformed output
xslProc.output=response 'asp object
'now this is the main dish
[blue]set ointerface=new asp_xsl
xslProc.addObject ointerface, "urn:asp-xsl-interfacing"[/blue]
xslProc.transform()
[blue]set ointerface=nothing[/blue]
[/tt]
[4] That is the skeleton of how to get thing done. Most of transformation algorithm is quite standard though involved. (Actually the more advanced the thing looks, most often the easier it is.) If you are not familiar with that algor, check out msdn knowledge base for detail.
[5] The elaboration of the skeleton can be well beyond recognition. But the above contains the essential idea.