[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: apply-templates repeats inside xsl:for-each, why
Ummm .. maybe I'm missing something, but isn't that exactly the same as <xsl:apply-templates select="$root/map/concept/concept[ @id = $platforms/platform/@id ]"/> ? (I'm too tired right now to explain this well, and many on this list are much better than I at explaining such things, but basically that says "select each /map/concept/concept that has an id= that is the same as the id= of one of the $platforms/platform elements, and apply templates to it". That is the "/map/concept/concept" grabs all of the <concept> elements that are children of a <concept> that are in turn children of the <map>, and the predicate selects only those that meet the condition. But the '=' comparison operator works on sequences, and the condition returns true for all 3.) > I fixed it for my purposes by doing it this way: > > <xsl:variable name="num" > select="count($platforms/platform)"/> <xsl:for-each > select="1 to $num"> > <xsl:variable name="n" select="position()"/> > <xsl:apply-templates select="$root/map/concept/concept[@id > = > $platforms/platform[$n]/@id]"/> > </xsl:for-each> > > Then I get the output just once like this: > > Windows XP > Windows Vista > Windows 7 > > Thanks for the help in breaking some adhesions.
|
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
|