xsl-list
[Top] [All Lists]

Get value from external file

2003-02-25 15:12:44
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:
<varValueElement>ELEMENT[Help='Yes']</varValueElement>

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,
Anders

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



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