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

xsl:for-each and xsl:apply-templates

Subject: xsl:for-each and xsl:apply-templates
From: Gerry McDonough <gmcdonough@xxxxxxxx>
Date: Wed, 1 Aug 2001 11:39:17 -0500
xsl for each child
It seems that calls to xsl:apply-templates from within an xsl:for-each loop are ignored.  As a result, I end up copying my template handling logic inside of the xsl:for-each loop.  Is this the only approach?  Are there other techniques?

If the question sounds vague, here is a sample of my problem:  Say I have a child node called "child" that appears in 2 different contexts: as a child of "parent1" and a child of "parent2".  My xml source may look like:

<parent1>
  <child/>
  <child/>
</parent1>

<parent2>
  <child/>
  <child/>
  <child/>
</parent2>

"child" should always be processed in the same way, but "parent1" and "parent2" need to wrap it differently.  (more concretely, "parent1" may be a table, and "parent2" may be an unordered list).  I use "xsl:for-each" to get the wrapping that I need, but I need to have my "child" template handling in 2 places.

Hope this makes sense, 

Thanks, Gerry


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.