Sorry about all the questions. Ah, the joys of being new to xslt
What I am trying to accomplish this time is output dependent upon presence of an attribute matching a variable. Here is roughly what I am trying to accomplish. Obvously, it doesn’t work, so this hinges on being able to understand theoretical, rather than actual, xslt.
<xsl:template>
<xsl:variable name="page" select="1" />
. . .
<xsl:apply-templates select="question[@page='$pg']" />
</xsl:template>
</pre><BR><BR>and in the xml<BR><BR><pre class="ip-ubbcode-code-pre">
<question page="1"> ... </question>
<question page="2"> ... </question>
...
Of course, it works when I replace @page=‘$pg’ with @page=‘1’ , or if I change the value in the xml to , the idea being that it will only display s with the correct page specified.
Ultimately, I’d really like to replace the variable with a param, because it is going to be set from outside the xslt (ASP.net), so the same xml file can be used and, based on the page param set from ASP.net, display elements corresponding to the current page.
What do I need to do to make it work with the variable, assuming the variable matches? What to make a param work?
Thanks in advance, sorry if it’s a lot of trouble for a simple answer. We all gotta start somewhere.
-Term