RE: [xsl] Asp Variable into XSLT

Subject: RE: [xsl] Asp Variable into XSLT
From: "Chris Bayes" <Chris@xxxxxxxxxxx>
Date: Wed, 13 Jun 2001 14:25:08 +0100
The way to do this is to pass a parameter into the transformation.

   dim doc, stylesheet
   set doc = Server.CreateObject("msxml2.DOMDocument")
   set stylesheet = Server.CreateObject("MSXML2.FreeThreadedDOMDocument")
   set template = Server.CreateObject("MSXML2.XSLTemplate");
   doc.async = false
   stylesheet.async = false
   template.stylesheet = stylesheet
   set proc = tem.createProcessor()
   proc.addParameter("someValue", someValue) ' someValue="this is the some
value string"
   proc.input = doc
   str = proc.output;

Then within your stylesheet you have
<xsl:stylesheet xmlns:xsl="";
<xsl:param name="someValue" />
<xsl:template match="/">
	<xsl:value-of select="$someValue" />

Ciao Chris

XML/XSL Portal

>-----Original Message-----
>From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of
>Sent: 13 June 2001 14:02
>To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>Subject: [xsl] Asp Variable into XSLT
>Plat: Win2000
>Lang: ASP
>Hi, I am curious as to how his works. As far as I know this could be very
>complicated / extremely difficult and as my XSLT book hasnt arrived, I will
>have to rely on your knowledge.
>I am making use of XML combined with ASP and generally just importing the
>xml file and converting it to html where needed with
>Now I want to make use of XML, but at times I will have an input variable
>from ASP, eg: if my page has loaded successfully, I want to display data
>from a specific XML element and if not then data from another XML element.
>Basically get an input variable into my XSL document I suppose.
>Im sure this is done and this comes across as just a daft question, but
>I've not come across it yet and cant find any examples.
>Thanks guys
> XSL-List info and archive:

 XSL-List info and archive:

Current Thread