[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Passing parameters from ASP to XSL within a for-next b

Subject: Passing parameters from ASP to XSL within a for-next block
From: Nadia Karasawa <nadiaimk@xxxxxxxxx>
Date: Tue, 11 Feb 2003 08:43:33 -0800 (PST)
asp parameters
I have a simple ASP function to transform a XML
document using parameters. It works pretty well, but
when I use it within a for-next block it works only
for the first iteration. It returns an empty string
for the others.

This is the function:

function transformXML(param1, param2, param3)
	dim xml, xsl
	dim proc, XSLTemplate

	'put the XML in an object
	Set xml =
Server.CreateObject("MSXML2.FreeThreadedDOMDocument")
	xml.async = False
	xml.load xmlPath

	'load the XSL into an object
	Set xsl =
Server.CreateObject("MSXML2.FreeThreadedDOMDocument")
	xsl.async = False
	xsl.load xslPath
	
	'add parameters to the xsl
	Set XSLTemplate =
Server.CreateObject("MSXML2.XSLTemplate")
	Set XSLTemplate.stylesheet = xsl

	Set proc = XSLTemplate.createProcessor

	'set the source of the data
	proc.input = xml
	
	proc.addParameter "param1", cstr(param1)
	proc.addParameter "param2", cstr(param2)
	proc.addParameter "param3", cstr(param3)
    
	proc.Transform
	transformXML = proc.output

	'clean up
	set xml = Nothing
	set xsl = Nothing
	set proc = Nothing
	set XSLTemplate = Nothing
end function

And how I'm calling it:

for i = lbound(myArray) to ubound(myArray)
	Response.write transformXML("x", "y", myArray(i)
next

Any ideas why it's not working?

Kind regards,
Nadia


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.