RE: Has document(string) in MSXML 3 (July preview) worked for any one?

Subject: RE: Has document(string) in MSXML 3 (July preview) worked for any one?
From: Ben Robb <Ben@xxxxxxxxxx>
Date: Tue, 19 Sep 2000 10:20:18 +0100
Sara wrote:

I'm posting my solution, in case someone else needs this. 
The solution, which seems rather extreme to me, is to change
the stylesheet in memory using DOM. Microsoft apparently has no
way to pass in a parameter in the call to the parser/XLST processor
which is what I would have preferred as a solution (is anyone 
from Microsoft listening? :-)



Ben replies:

Not true - use the XSLProcessor and the XSLTemplate objects in the DOM:

	Set objTemplate = Server.CreateObject("MSXML2.XSLTemplate")
	Set objTemplate.stylesheet = objXSL
	Set objProcessor = objTemplate.createProcessor
	objProcessor.input = objXML
	objProcessor.output = Response
	objProcessor.addParameter "aParameter", aParameterValue, "" 
	objProcessor.transform


As you can see, the objProcessor object (which is an instance of the XSL
processor) has a method called "addParameter" which can be called:

objXSLProcessor.addParameter(baseName, parameter, [namespaceURI])

where

baseName = The name that will be used inside the style sheet to identify the
parameter context. 

parameter = A number, boolean, string, XMLDOMNodeList, or XMLDOMNode.
Passing in a single node will produce a node list that contains one node
(shortcut). 

namespaceURI = Optional namespace.

Hope this helps,

Ben


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


Current Thread