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

RE: addParameter method and MSXML

Subject: RE: addParameter method and MSXML
From: "Jennifer Phillips" <Jennifer@xxxxxxxxxx>
Date: Fri, 22 Aug 2003 12:35:10 +0100
jen phillips
>Q: what class do I invoke to use the addparameter method with MSXML 4.0 ?
>my code below- my question refers to the COM object named 'XSLinput', -
what
>class should I use there so I can use the addParameter method widdit?
>Never mind the Cf bits, code is just shown here to be thorough..

Here is a example I wrote for another lister, shouldnt be that hard to
understand, to use it for MSXML 4.0, just add .4.0 after all the class
names.   Its a little different from a basic transformation without
parameters, you have to use the XSLTemplate and IXSLProcessor, but its not
that difficult.

Dim XSL
Dim XSLTemplate
Dim XSLProcessor
Dim XMLDom

' Create a DOM for the XSLT
' For some reason it must be FreeThreaded to work with XSLTemplate in MSXML3
set XSL = Server.CreateObject("MSXML2.FreeThreadedDOMDocument")

' Load in your stylesheet
XSL.Load "C:\xslt\brockTest2.xsl"

' Create the template object (Allows you to pass parameters)
set XSLTemplate = Server.CreateObject("MSXML2.XSLTemplate")

' Assign the XSLTemplate the style sheet you wish to use.

set XSLTemplate.stylesheet = xsl

set XMLDom = Server.CreateObject("MSXML2.DOMDocument")

'Load an XML
XMLDom.load("c:\xslt\test.xml")

' Create an XSL processor from the template
set XSLProcessor = XSLTemplate.createProcessor

' Add the parameter ' "DirectoryName" parameter must exist in the XSLT
XSLProcessor.addParameter "DirectoryName", server.MapPath("/") '

' Tell the XSLProcessor what the XML input is.
XSLProcessor.input = XMLDOM

' Do the transformation
XSLProcessor.transform

' Write out the result
Response.Write XSLProcessor.Output


If you have any questions let me know.

Jen


 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.