[XSLT] choose/when vs. if

Discussion in 'XML' started by Daniel M. Fichtner, Nov 15, 2004.

  1. 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>
    <xls:eek:therwise>
    </xls:eek:therwise>
    </xls:choose>
    </xls:for-each>
    ------------------------

    TIA,

    Daniel
     
    Daniel M. Fichtner, Nov 15, 2004
    #1
    1. Advertising

  2. 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
    <xsl:eek:therwise>
    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-Conditional-Processing-with-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/
     
    Martin Honnen, Nov 15, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stylus Studio
    Replies:
    0
    Views:
    775
    Stylus Studio
    Aug 3, 2004
  2. Benjamin Hillsley
    Replies:
    3
    Views:
    1,751
    Dimitre Novatchev
    Sep 25, 2003
  3. ted
    Replies:
    1
    Views:
    655
    Laurens
    Jan 26, 2004
  4. Replies:
    2
    Views:
    742
    Henry S. Thompson
    Oct 19, 2005
  5. Replies:
    4
    Views:
    716
Loading...

Share This Page