XSLT Access outer loop from inner

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Newbie

    XSLT Access outer loop from inner

    I need to iterate through all the cells in an HTML-like table, e.g.

    <for-each select="tr">
    <for-each select="td">
    Get coordinates of cell here
    </for-each>
    </for-each>

    How can I access my position in the outer loop from within the inner loop?

    --
    Posted via a free Usenet account from http://www.teranews.com

  • Newbie

    #2
    Re: XSLT Access outer loop from inner

    Newbie wrote:
    I need to iterate through all the cells in an HTML-like table, e.g.
    <snip>
    How can I access my position in the outer loop from within the inner loop?
    Forgot to mention; I can do this with

    <for-each select="tr">
    <xsl:variable name="outer" select="positio n" />
    <for-each select="td">
    Get coordinates of cell here
    </for-each>
    </for-each>

    Is there a direct route, without declaring a variable?

    --
    Posted via a free Usenet account from http://www.teranews.com

    Comment

    • Martin Honnen

      #3
      Re: XSLT Access outer loop from inner



      Newbie wrote:

      Forgot to mention; I can do this with
      >
      <for-each select="tr">
      <xsl:variable name="outer" select="positio n" />
      select="positio n()"
      <for-each select="td">
      Get coordinates of cell here
      </for-each>
      </for-each>
      >
      Is there a direct route, without declaring a variable?
      I think the variable is the way to go with.

      --

      Martin Honnen

      Comment

      • toudidel

        #4
        Re: XSLT Access outer loop from inner

        in my opinion you should forget about the <xsl:for-eachelement because
        it's most terrible element. instead of it use <xsl:apply-templatewith
        <xsl:with-paramif needed

        td


        Comment

        • Newbie

          #5
          Re: XSLT Access outer loop from inner

          toudidel wrote:
          in my opinion you should forget about the <xsl:for-eachelement because
          it's most terrible element. instead of it use <xsl:apply-templatewith
          <xsl:with-paramif needed
          Why?

          --
          Posted via a free Usenet account from http://www.teranews.com

          Comment

          Working...