Quote:
Originally Posted by gib65
Hello,
I'm a complete newbie to XSL, and I need to ask some newbie questions:
I've got this line from an XSL file:
<xsl:value-of select="$lureportcaptions[@CAPTIONID=1]/@CAPTION" />
What does the $ and the @ mean?
|
$ , when you declare a variable for example:
<xsl:variable name="dollar-to-know" select="//dollar"/>
to call that variable, whether it may be global or local variable, dollar symbol will used to call that vairbale in template level.
<xsl:template match="variable">
<xsl:value-of select="$dollar-to-know"/>
</xsl:template>
@ is used to declare or call attribute from the element.
in your example.
<xsl:value-of select="$lureportcaptions[@CAPTIONID=1]/@CAPTION" />
they are calling the variable 'lureportcaptions'/atrribute captionid/value of attribute caption.
input file may be like this.
<lureportcaptions captionid=1 caption="somevalue">
output will get- "somevalue"