[xsl] Re: Pass a DOM as an XSLT parameter?

Subject: [xsl] Re: Pass a DOM as an XSLT parameter?
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Mon, 15 Dec 2003 07:15:45 +0100
<cknell@xxxxxxxxxx> wrote in message
> I've been asked to process two XML documents with one XSLT stylesheet. One
document exists in the file system and the other exists in memory as the
result of a SQL Server 2000 "for XML" query. In an ideal world, I would
write a stylesheet to process the file-system XML document and bring the
in-memory XML document into the transformation via the document() function.
Since the document() function takes as a parameter a URI, and since I can't
think of a way to give a URI to the in-memory document, I'm stumped. I've
thought of creating a DOM from the in-memory XML and passing the DOM as a
parameter, but I'm pretty sure that won't work.

Why, this is a typical operation using the MSXML4 API

Read about IXSLProcessor.addParameter() method. You'll have to pass to it a
node-set as a parameter.

If you have the "in-memory" xml document represented as a string, you will
have to pass this string to the IXMLDOMDocument.loadXML() method, then you
will pass the root node of the returned tree as parameter. Look for examples
in your MSXML4 SDK documentation.


Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

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

Current Thread