Subject: RE: [xsl] Parameters in XPath From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> Date: Tue, 7 Jan 2003 18:43:22 -0000 |
> 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Parameters in XPath, David Carlisle | Thread | RE: [xsl] disable-output-escaping=", Passin, Tom |
Re: [xsl] Number of times apply-tem, David Carlisle | Date | RE: [xsl] generating xml with a run, Michael Kay |
Month |