[xsl] How to Display as text the select predicates of apply-templates
Subject: [xsl] How to Display as text the select predicates of apply-templates
From: david <dariggs@xxxxxxxxxxxxxx>
Date: Thu, 20 Jan 2005 16:07:41 +0900
|
I am using xslt to search an xml file of resonses to a survey. I want to
display the search predicates at the top of the results of the search.
How do I get at the text of the search to show what the argument was
that produced the result which I am displaying?
I put the search into a variable at the top of the xslt file:
<xsl:variable name="bool"
select="/responses/response[section/number_sewn > 3]"/>
And then use it
<xsl:apply-templates select="$bool">
I also want to display the search argument on the output, so I know what
it was that this output is searching for.
If I use <xsl:value-of select="$bool"/> I just get the text value of the
first element of the selected set. And if I first define the search
argument as a string with select="'/responses/...... '" (double-quoting
to make it a string, not a node set), I can display that easily enough,
but I cannot find a way to make that variable then select a node set.
Seems so simple, and it is so simple that I cannot find it in the
archives. Sorry for such a trivial question.
Many thanks.
David Riggs
Kyoto