#1 stx:for-each and the current node

v1.0
closed-accepted
nobody
None
5
2003-04-25
2002-10-25
No

The mechanism of the for-each loop needs to be
clarified in STX. Like in XSLT 2.0, it iterates through
a sequence of items. If the sequence contains nodes,
there may be problems with using the current item as
the current node, since the context information for the
current item (that is node) can be no more available.

Discussion

  • Petr Cimprich

    Petr Cimprich - 2002-10-25
    • labels: 403511 -->
    • milestone: 187310 -->
     
  • Petr Cimprich

    Petr Cimprich - 2002-10-25
    • milestone: --> v1.0
    • status: open --> open-accepted
     
  • Oliver Becker

    Oliver Becker - 2003-03-17

    Logged In: YES
    user_id=76736

    The context information (especially ancestor nodes) of a
    single node is only available for nodes on the ancestor stack.
    Once a node has been stored (in a variable), or stems from a
    function call (e.g. item-at), or is the current node in a
    for-each
    this context is lost.
    In the STXPath grammar '.' addresses the current node, but
    doesn't allow following steps.

     
  • Petr Cimprich

    Petr Cimprich - 2003-04-25
    • status: open-accepted --> closed-accepted
     
  • Petr Cimprich

    Petr Cimprich - 2003-04-25

    Logged In: YES
    user_id=149440

    A solution with an implicit local variable has been
    introduced in WD 24 April 2003.

    <stx:for-each-item name="current" select="$seq">
    <stx:value-of select="$current"/>
    </stx:for-each-item>

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks