Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > [XSLT] choose/when vs. if

Reply
Thread Tools

[XSLT] choose/when vs. if

 
 
Daniel M. Fichtner
Guest
Posts: n/a
 
      11-15-2004
Hello,

due to performance reasons I need to know whether the xsl:when-Statement has
an implied "break" statement, so that the parser do not touch the other when
statements or if it is similar to the if statements.

listing
----------------------
<xls:for-each ...>
<xls:choose>
<much xls:when ...>
do sth.
</much>
<xlstherwise>
</xlstherwise>
</xls:choose>
</xls:for-each>
------------------------

TIA,

Daniel


 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      11-15-2004


Daniel M. Fichtner wrote:


> due to performance reasons I need to know whether the xsl:when-Statement has
> an implied "break" statement, so that the parser do not touch the other when
> statements or if it is similar to the if statements.


The first matching
<xsl:when test>
is used, or the
<xsltherwise>
whichever comes first. There is no need to exit or break from an
<xsl:when> as the spec
http://www.w3.org/TR/xslt#section-Co...ith-xsl:choose
clearly says "The content of the first, and only the first, xsl:when
element whose test is true is instantiated.".


--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments