xslt - XSL for-each filtering; how to evaluate TWO variable in select? -


<xsl:variable name="filtervalue"  >@subject = 'subject filter on'</xsl:variable> <xsl:for-each select="$rows[$filtervalue]"> 

it seems me $filtervalue being treated literal string rather being evaluated. how can make variable's value evaluated instead?

desired result:

<xsl:for-each select="$rows[@subject = 'subject filter on']"> 

i apologize if has been answered before, don't know terminology xsl i'm having trouble searching online. thanks.

dynamic evaluation of xpath expressions not supported in both xslt 1.0 , xslt 2.0.

usually, there workarounds.

in specific case can have (global/external) parameters:

  <xsl:param name="attrname" select="'subject'"/>   <xsl:param name="attrvalue" select="'subject filter on'"/> 

and in code:

<xsl:for-each select="$rows[@*[name()=$attrname] = $attrvalue]">  

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -