[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using XSL parameters to construct variables to con
> XML snippet: > <process> > <number>1</number> > <name>evaluate</name> > <descrip>[Description.]</descrip> > </process> > > XSL snippet: > <!-- default value of params is empty string; if user chooses a processArea option, I'll send the parameter to the stylesheet and set this value --> > <xsl:param name="processArea" /><!-- if sent, value will be 1, 2, 3 or 4 --> > . . . > . . . > <xsl:variable name="selectStatement">/process-report/process > <xsl:if test="$processArea != ''">[starts-with(number,<xsl:value-of select="$processArea"/>)]</xsl:if> > </xsl:variable> > . . . > . . . > <xsl:apply-templates select="$selectStatement"/> > This is a FAQ: Standard XSLT 1.0 and 2.0 do not support dynamic evaluation of string representation of an XPath expression. And in this case dynamic evaluation is not necessary -- use: <xsl:apply-templates select="process[starts-with(number, $processArea)]"/> ===== Cheers, Dimitre Novatchev. http://fxsl.sourceforge.net/ -- the home of FXSL XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|