Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-30-2010, 11:06 PM   PM User | #1
Nomistic
New to the CF scene

 
Join Date: Apr 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Nomistic is an unknown quantity at this point
call-template within a for-each in XSLT

Hi, is it possible to call templates within a for-each statement?

I'm looking for something like this... I have successfully created a style sheet that will call information from a TEI-encoded xml document, but I just discovered a file in the document that has more than one letter in it.

I just need it to loop through the entire call of the content.

Here's what I have (that does not work)

Code:
<xsl:for-each select="*/tei:div">
<div class="content">

	<xsl:call-template name="letterOpener"/>
	<xsl:call-template name="text" />
	<xsl:call-template name="letterCloser"/>
	<xsl:call-template name="margin"/>
	
</div>	
</xsl:for-each>
Thank you so much in advance for your help. Please let me know if you need to see more code... I've been staring at this for hours.

Last edited by Nomistic; 05-01-2010 at 12:11 AM..
Nomistic is offline   Reply With Quote
Old 05-01-2010, 03:34 AM   PM User | #2
Nomistic
New to the CF scene

 
Join Date: Apr 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Nomistic is an unknown quantity at this point
Cool solved

Okay, this was a case of overthinking, and not wanting to rewrite the sheet.

The issue was that the letter needed to be repeated with a for-each within the template itself, and to blend all of the above templates into one for the letter.
Nomistic is offline   Reply With Quote
Reply

Bookmarks

Tags
call-template, for-each, xml, xsl, xslt

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:25 PM.


Advertisement
Log in to turn off these ads.