[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Parameters in XPath
> What I'm trying to accomplish with the Filter > parameter is to dynamically pass into the stylesheet a > XPath expression to be evaluated. > For example: > > <xsl:param name="Filter" select="@rebate>9.99 and > @shippingMethod='Ground' and @cost<199.99"/> > > <xsl:apply-templates > select="/Cat[@CatId=$Cat]/Prod[$Filter]"/> > And I think several people explained (a) that you can't do this, except with the xx:evaluate() extension that several processors provide, and (b) that if you do use these extensions, the select attribute must be a string containing the expression, not the expression itself: so you need to write: <xsl:variable name="defaultFilter">@rebate > 9.99 and @shippingMethod='Ground' and @cost < 199.99</xsl:variable> <xsl:param name="Filter" select="string($defaultFilter)"/> If you write it your way, $Filter will be the value of the expression, not the expression itself. Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx 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
|