Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] xsl:for-each and xsl:apply-templates

From: Gerry McDonough <gmcdonough@-------->
To:
Date: 8/1/2001 8:40:00 AM
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


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent