[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Value-of varible question

Subject: RE: Value-of varible question
From: "Hansen, John" <John.Hansen@xxxxxxxxxx>
Date: Fri, 16 Apr 2004 14:28:32 -0700
varible
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.