greetings,
I have an xslt page that will incorporate data from 2 separate xml files. I have references to these xml files set up as variables, $data1 and $data2. I can easily access data from either file by using:
Code:
<xsl:value-of select="$data1/node1/node2" />
or
Code:
<xsl:value-of select="$data2/node1/node2" />
my problem comes in when I try to use a template to match to either of these.
I'm trying to do:
Code:
<xsl:template name="header_baseinfo" match="$data1/node1/node2[@name='header']">
<p>Computer Name: <xsl:value-of select="computername" /></p>
<p>Report Name: <xsl:value-of select="reportname" /></p>
</xsl:template>
and then call this template (by name) inside the master page template. When I do this, I get an error telling me that I cannot use a variable name in the "match" attribute.
I know I could just as easily do:
Code:
<xsl:template name="header_baseinfo" >
<p>Computer Name: <xsl:value-of select="$data1/node1/node2[@name='header']/computername" /></p>
<p>Report Name: <xsl:value-of select="$data1/node1/node2[@name='header']reportname" /></p>
</xsl:template>
but this seems terribly inefficient. There's got to be a better way.
Any ideas?