[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Get value from external file

Subject: Get value from external file
From: "Anders Svensson" <anders.svensson@xxxxxxxxxxx>
Date: Tue, 25 Feb 2003 23:12:44 +0100
value file
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.