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

Re: break or exit in xsl?

Subject: Re: break or exit in xsl?
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Mon, 7 Mar 2005 04:56:13 -0800 (PST)
xsl for each exit
I wish to add something important.. There is something
called "document order" - which is order of nodes in
the original document(and it is fixed). In
xsl:for-each the select attribute evaluates to a
node-set. The XSLT 1.0 spec says (about select
attribute of xsl:for-each).. "the nodes are processed
in document order, unless a sorting specification is
present"..

So the "select attribute" of for-each selects a
subtree with the original tree.. And this subtree
(i.e. the node-set) is processed in document order..
So you can expect in which order the output will
appear!

So it is sequential processing from "document order
point of view"..  

Regards,
Mukul

--- Mukul Gandhi <mukul_gandhi@xxxxxxxxx> wrote:
> if I can add a bit to what others have said..
> 
> When we specify some XPath expression in select
> attribute of xsl:for-each (like Person/Age), we are
> asking the XSLT processor to select a portion of
> input
> tree, and traverse all the nodes "on this subset" of
> input tree. The nodes of this subtree (specified by
> select attribute) may be scattered at various places
> in the original source tree. The processor has to
> traverse the nodes of this subtree. It may do so
> using
> any strategy like parallel, depth-first-search,
> breadth-first-search or something similar..
> 
> So imagining sequential execution in xsl:for-each
> loop
> is not right..
> 
> Regards,
> Mukul
> 
> --- Katharina Kreis <katharinakreis@xxxxxx> wrote:
> > Hi!
> > 
> > I need to exit my xsl:for-each tag when I'm
> reaching
> > a value. Example:
> > 
> > <xsl:for-each select="Person/Age">
> >     <xsl:if test=".='30'>
> >        ...
> >        <!-- Here I need to exit xsl:for-each -->
> >     </xsl:if>
> > </xsl:for-each>
> > ...
> > 
> >  In Java or C++ there exists a break or exit
> keyword
> > to do this. How can 
> > I do this with xsl?
> > 
> > Katharina



	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/

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.