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

[XSLT Streaming] Are xsl:for-each and xsl:iterate equ

Subject: [XSLT Streaming] Are xsl:for-each and xsl:iterate equivalent?
From: "Costello, Roger L." <costello@xxxxxxxxx>
Date: Thu, 29 Aug 2013 13:10:06 +0000
 [XSLT Streaming] Are xsl:for-each and xsl:iterate  equ
Hi Folks,

I realize that xsl:iterate has some capabilities that xsl:for-each doesn't
have, such as the ability to break out of the loop before processing the
entire sequence.

But leaving that aside, they are both ways of looping over a sequence of
items, right? And both can be used with streaming, right?

Is xsl:iterate the preferred loop mechanism when doing streaming?

The following are equivalent, right? Is one preferred over the other?

-----------------------------------------------------
    Loop using xsl:iterate
-----------------------------------------------------
    <xsl:template match="BookCatalogue" mode="streaming">
        <Books>
            <xsl:iterate select="Book">
                <Book>
                    <Title><xsl:value-of select="Title" /></Title>
                    <Author><xsl:value-of select="Author" /></Author>
                </Book>
            </xsl:iterate>
        </Books>
    </xsl:template>

-----------------------------------------------------
    Loop using xsl:for-each
-----------------------------------------------------
    <xsl:template match="BookCatalogue" mode="streaming">
        <Books>
            <xsl:for-each select="Book">
                <Book>
                    <Title><xsl:value-of select="Title" /></Title>
                    <Author><xsl:value-of select="Author" /></Author>
                </Book>
            </xsl:for-each>
        </Books>
    </xsl:template>

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.