[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|