... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)

2004-05-14

ASP

Here is an ASP snippet that injects request parameters into XSLT to generate a web page:

<%@ Language = "JScript" %>
<%
var myparam = String(Request.queryString("myparam"));

var xslDoc = Server.createObject("Msxml2.FreeThreadedDOMDocument.4.0");
xslDoc.load(Server.mapPath("mystyle.xsl"));

var xmlDoc = Server.CreateObject("Msxml2.DOMDocument.4.0");
xmlDoc.load(Server.mapPath("mydata.xml"));

var xslt = Server.createObject("Msxml2.XSLTemplate.4.0");
xslt.stylesheet = xslDoc;
var xslProc = xslt.createProcessor();
xslProc.input = xmlDoc;
xslProc.addParameter("myparam", myparam);
xslProc.transform();
Response.write(xslProc.output);
%>

Blog Archive