cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ed Staub <est...@silknet.com>
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 (www.cranesoftwrights.com).
Searching for "$@" found a page which is directly on point.

You want to use something like 
<xsl:variable name="filteredData"
select="$data//row[@*[local-name(.)=$attr]]"/>

Please note: I haven't tried this!

-Ed Staub
Kana Communications, Inc.

-----Original Message-----
From: gross@Cyveillance.com [mailto:gross@Cyveillance.com]
Sent: Friday, June 02, 2000 2:08 PM
To: cocoon-users@xml.apache.org
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: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org

Mime
View raw message