[xsl] Get value from external file

Subject: [xsl] Get value from external file
From: "Anders Svensson" <anders.svensson@xxxxxxxxxxx>
Date: Tue, 25 Feb 2003 23:12:44 +0100
Hi all,
I have an xsl file which formats xml files into html, online help etc, and the xml has attributes at certain elements to "profile" the documents into different versions (different formats, users,  etc). The xsl creates the profiled versions by selecting elements by their profile attributes. For example an element can look like this:

<ELEMENT Help='Yes'>

The xsl can then select these particular elements by select statements such as <xsl:apply-templates select="ELEMENT[Help='Yes']/>.
BUT, and here's the question: I need to be able to place the profiling select value in a separate file so I can keep the xsl intact, rather than changing it for each version transformation. That way I only need to change the (xml)file containing the value, and fetch it using a variable. (E.g.)

I would like to be able to do something like this:
xml document containing the value:

In the xsl file:
<xsl:param name="varValue" select="document('varValue.xml')/varValueElement"/>
<xsl:apply-templates select="ELEMENT[Help='Yes']/>

I have tried the variable when setting the value inside the xsl, and that works fine, but when I try to fetch the value from the separate xml file, it doesn't work. Does anyone know what I'm doing wrong?
Any help or suggestions greatly appreciated!

Best regards,

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

Current Thread