cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ed Staub <>
Subject RE: Dynamic XPath filtering
Date Fri, 02 Jun 2000 19:09:11 GMT
(Hint/Plug:) The answer was in the first place I always look for gnarly XSLT
info: the intro to XSLT from Crane Softwrights (
Searching for "$@" found a page which is directly on point.

You want to use something like 
<xsl:variable name="filteredData"

Please note: I haven't tried this!

-Ed Staub
Kana Communications, Inc.

-----Original Message-----
From: []
Sent: Friday, June 02, 2000 2:08 PM
Subject: Dynamic XPath filtering

I am trying to use XPath to filter a node-set.  This works great when I know
which attribute I'm filtering on ahead of time.  For example:

<xsl:variable name="data" select="document('page.xml')"/>
<xsl:variable name="filteredData" select="$data//row[@name!='']"/>

However, when I don't know the name of the attribute ahead of time, it gets
upset.  For example:

<xsl:variable name="attr" select="name"></xsl:variable>
<xsl:variable name="filteredData" select="$data//row[@$attr!='']"/>

Does anyone know how to do this?

	- Greg

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message