Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

  • #2
    New to the CF scene
    Join Date
    Apr 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •