|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Value-of varible question
The problem with John Hamman's original code
<xsl:param name="local" select="'en-EN'"/>
<xsl:template match="Title">
<Title>
<xsl:copy-of
select="/iThink.ePulp/Page/Content/Meta/Title[@lang=$local]"/>
</Title>
</xsl:template>
is that the select of the xsl:copy-of isn't relative to the current node
matched by the xsl:template match="Title" element. But as written even
if the copy-of was relative he would get output like
<Title>
<Title lang="en-US">Williamsburg Web Design</Title>
</Title>
since copy-of will copy the selected nodes (which are the Title elements
having a lang attribute with the value of $local). As written, with the
non-relative select on the copy-of, the code executes something like
this:
for each Title found in the document (relative to the current node)
insert into the output stream a Title element containing
a copy of every Title element at the specified nesting level with a
lang attribute equal to $local
John Hansen
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








