From the Microsoft XML 4.0 Parser help file:
var xslt = new ActiveXObject("Msxml2.XSLTemplate.4.0");
var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0");
var xslProc;
xslDoc.async = false;
xslDoc.load("sample2.xsl");
xslt.stylesheet = xslDoc;
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
xmlDoc.async = false;
xmlDoc.load("books.xml");
xslProc = xslt.createProcessor();
xslProc.input = xmlDoc;
xslProc.transform();
alert(xslProc.output);
--
Charles Knell
cknell(_at_)onebox(_dot_)com - email
-----Original Message-----
From: "Jay Zeiger" <jzeiger(_at_)webserve(_dot_)net>
Sent: Mon, 7 Jul 2003 17:18:34 -0400
To: <XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject: [xsl] ASP and MSXML AddParameter
I have coded ASP (thanks to internet.com) so that I can display XML/XSL
files, but I need to add the "AddParameter" method. I have read some older
posts here, but I can't quite figure out how to do this. If I wanted to add
a parameter named "param1", I think I need something like:
if len(strOptionalParam1) then
Set xslProc = xslt.createProcessor()
xslProc.input = xmlDoc ' >>>>>>---- what is this xmlDoc suppose to
refer
to??????
xslProc.addParameter "param1", strOptionalParam1
xslProc.Transform
end if
'
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++
' + But, how is this properly integrated into my function (assume that
strOptionalParam1
' + contains the param1 value) ????????????????????
'
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++
Function loadXMLFile(strXMLFile, strXSLFile, strOptionalParam1)
'Declare local variables
Dim objXML
Dim objXSL
Dim xslProc
'Instantiate the XMLDOM Object that will hold the XML file.
set objXML = Server.CreateObject("Microsoft.XMLDOM")
'Turn off asyncronous file loading.
objXML.async = false
'Load the XML file.
objXML.load(strXMLFile)
if len(strXSLFile) then
'Instantiate the XMLDOM Object that will hold the XSL file.
set objXSL = Server.CreateObject("Microsoft.XMLDOM")
'Turn off asyncronous file loading.
objXSL.async = false
'Load the XSL file.
objXSL.load(strXSLFile)
Response.Write(objXML.transformNode(objXSL))
else
Response.Write (objXML.transformNode(objXML))
end if
if Err.Number then
ErrorReportingRoutine()
end if
End Function
'
' THANKS very much!!
'
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list