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: Andrew Kimball <akimball@xxxxxxxxxxxxx>
Date: Mon, 18 Sep 2000 18:06:40 -0700

There is a way to pass parameters to stylesheets, just not through the
selectNodes interface (that's now just a convenience function for the full
XSLTemplate/XSLProcessor objects).  For more details, see the documentation
that comes with the 3.0 SDK download.  Lookup "IXSLProcessor, addParameter"
and "XSLTemplate examples" for information and example code.

BTW, your solution below was the recommended way to simulate parameters
using the IE5 release of XSL (2.5).  That is no longer necessary with 3.0.

~Andy Kimball

-----Original Message-----
From: sara.mitchell@xxxxxxxxx [mailto:sara.mitchell@xxxxxxxxx]
Sent: Monday, September 18, 2000 5:02 PM
To: xsl-list@xxxxxxxxxxxxxxxx
Subject: RE: Has document(string) in MSXML 3 (July preview) worked for
any one?
Sensitivity: Private

Thanks to all of you that passed along suggestions on this issue. 
I have fixed the problem, and it was, as suspected, caused by 
MSXML not having a 'base URI' for the document because everything
is happenind in memory. 

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? :-)

I didn't want to change the stylesheet in memory as this same 
document will later have to go through XT, but I did find a 
way to 'mimic' the parameter passing facility so that the 
stylesheet should work properly for XT also. 

Here's the pertinent snippet from the stylesheet: 

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="";

<xsl:output method="html" version="4.0" indent="yes"/>

<xsl:param name="docpath"/>

<xsl:param name="shrdict">
 <xsl:when test="contains($docpath,'casper')">
 <xsl:when test="contains($docpath,'services')">

The parameter 'shrdict' ends up with the fully qualified path
to the second document that needs to be opened. It uses 'docpath'
to get the path to the XML document that is primarily being

The parameter 'docpath' gets a URL passed in. For XT, this is 
passed using the standard methods. For MSXML, the value of 
the parameter is 'passed' by changing the stylesheet in memory
in the JScrip macro run from XMetal:

//Pass the active document path into the stylesheet as a global-parameter
  var partialpath = ActiveDocument.Path;
  partialpath = partialpath.replace(':','|');
  partialpath = partialpath.replace('\\+','/');
  var newpath = xsldoc.createTextNode(partialpath);

  var param = xsldoc.selectSingleNode("//xsl:param[@name='docpath']");


 XSL-List info and archive:

 XSL-List info and archive:

Current Thread