xsl-list
[Top] [All Lists]

RE: Problems passing parameters using MSXML 3.0

2004-04-12 14:34:46
Hi Jon,

Do any of you have code laying around that passes parameters to a
transform using MSXML 3.0?  
Any example would be greatly appreciated, web-page script or not!

I used to use the following function in my older classic ASP apps, using
MSXML 3.0, and Jscript. The compiled processor 'srcDoc' was created in the
Global.asa file, and passed into the function as a parameter. Note that the
parameter 'IdCd' needed to be casted to a string because it was passed in as
part of the QueryString (I remember well that passing it in "as was" didn't
work even if you would expect it to work).

// transforms the XML using the compiled XSL Stylesheet
// in this case, the response object is used to output the result tree
function
transformDataS(srcDoc,xslProc,IdCd,Fecha,Hora,Fecha1,Fecha2,Fecha3,Fecha4) 
{
  // point to the compiled processor
  xslProc.input = srcDoc;
  // add the parameters used inside the stylesheet
  xslProc.addParameter("Hora", Hora, "");
  xslProc.addParameter("Fecha", Fecha, "");
  xslProc.addParameter("Fecha1", Fecha1, "");
  xslProc.addParameter("Fecha2", Fecha2, "");
  xslProc.addParameter("Fecha3", Fecha3, "");
  xslProc.addParameter("Fecha4", Fecha4, "");
  xslProc.addParameter("IdCd", IdCd.toString(), "");
  // perform the XSL Transformation
  xslProc.transform();
  // write result to browser
  Response.Write(xslProc.output);
  return true;
}

If you need more help let us know.

HTH, Pieter 


<Prev in Thread] Current Thread [Next in Thread>