xsl-list
[Top] [All Lists]

Re: parameter use in XPath

2003-10-23 01:38:55
My brain is fried for the evening... If no one else has been able to help
with this ill take another stab in the morning (US MST).

Best regards,

M.

----- Original Message ----- 
From: "Saverio Perugini" <sperugin(_at_)csgrad(_dot_)cs(_dot_)vt(_dot_)edu>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Wednesday, October 22, 2003 10:19 PM
Subject: Re: [xsl] parameter use in XPath


On Wed, 22 Oct 2003, M. David Peterson wrote:

There are some work arounds to this issue
that you may find useful.  Heres one...

<xsl:param name="keyword"/>
<xsl:key name="keywordMatch" match="foo" use="@bar"/>

<xsl:template match="/">
<xsl:for-each select="//foo/bar">
    <xsl:for-each select="key(keywordMatch, $keyword)">
        ...
    </xsl:for-each>
</xsl:for-each>
</xsl:template>

Thanks.  This work around
appears to create a key named keywordMatch on all foo elements
by the attribute bar.  It then uses this key in a double
nested for loop to iterate through all foo elements whose
bar attribute matches the keyword parameter input.

While I am not sure how this code can be manipulated
to help solve my problem, it appears as if
this approach entails significantly modifying the
search strategy in my original stylesheet (which
was slightly complex even in the absence of this
parameter issue).

Are there any EXSLT functions capable of solving
my problem without a significant rewrite of the
stylesheet?

Many Thanks,
Saverio

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



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



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