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

apply-templates repeats inside xsl:for-each, why

Subject: apply-templates repeats inside xsl:for-each, why
From: "Mark Giffin m1879@xxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 16 Jun 2014 00:23:35 -0000
 apply-templates repeats inside xsl:for-each
I'm running xsl:for-each on a variable $platforms that holds this:

      <platform name="windows_xp" id="unique_2"/>
      <platform name="windows_vista" id="unique_35"/>
      <platform name="windows_7" id="unique_37"/>

The following code produces the same output 3 times for each node in $platforms:

<xsl:for-each select="$platforms/platform">
<xsl:apply-templates select="$root-of-input-file/map/concept/concept[@id = @id]"/>
</xsl:for-each>


So in the output I get this kind of thing:

Windows XP
Windows Vista
Windows 7
Windows XP
Windows Vista
Windows 7
Windows XP
Windows Vista
Windows 7

I was expecting to get one output for each element in $platforms. If I use the following outside of xsl:for-each, I get one output:

<xsl:apply-templates select="$root/map/concept/concept[@id = 'unique_2']"/>

What am I missing?

thanks,
Mark

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.