This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: parsing a variable from a ASP page to XSL file
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] parsing a variable from a ASP page to XSL file
- From: "Kevin Read" <kevin at synergysa dot com dot au>
- Date: Fri, 8 Jun 2001 11:43:58 +0930
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Howard
Close - but no cigar
here is a code snippit that shows how to pass parameters to XSL via ASP (VB
Script)
set xslt = server.createObject("Msxml2.XSLTemplate")
Set xslDoc = server.createObject("Msxml2.FreeThreadedDOMDocument")
Set xmlDoc = server.createObject("Msxml2.DOMDocument.3.0")
xslDoc.async = false
xslDoc.load ( Server.MapPath(xslFile) )
xslt.stylesheet = xslDoc
xmlDoc.async = false
xmlDoc.load (Server.MapPath(xmlFile))
Set xslProc = xslt.createProcessor()
xslProc.input = xmlDoc
xslProc.addParameter "BUYGROUP", BUYGROUP
xslProc.addParameter "PARAM1", "Hello"
xslProc.Transform
result = xslProc.output
result now has the final output
Kevin
-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Howard Lim
Sent: Friday, 8 June 2001 6:41 AM
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] parsing a variable from a ASP page to XSL file
I am having some problem in parsing a variable from a ASP page to XSL file.
this is the ASP page:
doc.load(xmlsource)
stylesheet.load(xslsource)
oParam=SelectSingleNode("//xsl:param[@name='param1']")
oparam.text="hello"
Response.Write(doc.transformNode(stylesheet))
i have the following code in my XSL file to get the variable parse from ASP
page.
<xsl:value-of select="item[$param1]"/>
Is this the right way to parse a variable to XSL file???
Please help, thank you guys.
Howard
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list