Subject: [xsl] RE: From: "Andrew Welch" <andrew@xxxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 11 Jun 2001 12:25:12 +0100 |
Hi, Try: <% Response.Buffer=True %> <% Dim xml Dim xsl Dim template Dim processor Set xml = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.3.0") xml.async = false xml.load (Server.MapPath("***xmlfilehere")) Set xsl = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.3.0") xsl.async = false xsl.load (Server.MapPath("***xslfilehere)) Set template = Server.CreateObject("MSXML2.XSLTemplate") template.stylesheet = xsl set processor = template.createProcessor() processor.input = xml myParam = Request.querystring("myParam") if searchVal <> "" then processor.addParameter "param1", myParam end if processor.transform() Response.write (processor.output) %> This will pick a parameter out of the url in this format thisaspfile.asp?myParam=whatevervalue and to 'get it' into the xsl file, add directly beneath the <xsl:stylesheet> element <xsl:param name="param1"/> you can then access the parameter using $param1 (or whatever you call it) in the xsl file. Hope this helps andrew -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Howard Lim Sent: 07 June 2001 22:04 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: I am having some problem in parsing a variable from a ASP page to XSL file. this is the ASP page: <% dim doc, stylesheet set doc = Server.CreateObject("msxml2.DOMDocument") set stylesheet = Server.CreateObject("msxml2.DOMDocument") xmlsource=Server.MapPath("XML/XML_1.xml") xslsource=Server.MapPath("XSL/XSL_1.xsl") doc.async = false stylesheet.async = false 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 (Kian-How) Lim howard.lim@xxxxxxxxxxxx 847-934-8100 ext 104 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.260 / Virus Database: 131 - Release Date: 06/06/2001 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.260 / Virus Database: 131 - Release Date: 06/06/2001 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] RE: parsing a variable from a, Chris Bayes | Thread | [xsl] parsing a variable from a ASP, Howard Lim |
[xsl] Re: Problem while inserting n, Dimitre Novatchev | Date | Re: [xsl] Re: Re: Sorting date in x, Viktor Kozyrev |
Month |