|
[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
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>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart


![[XSLT Streaming] Are xsl:for-each and xsl:iterate equ](/images/get_stylus.gif)





