xsl-list
[Top] [All Lists]

[xsl] Re: xsl-list Digest 10 Dec 2006 06:10:01 -0000 Issue 984

2006-12-10 05:42:18
xsl-list-digest-help(_at_)lists(_dot_)mulberrytech(_dot_)com napisał(a):
xsl-list Digest 10 Dec 2006 06:10:01 -0000 Issue 984

Topics (messages 32605 through 32606):

How to get cotext of foreach caller
        32605 by: PiGalKOM
        32606 by: Andrew Welch

Administrivia:

To subscribe to the digest, e-mail:
        <xsl-list-digest-subscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>

To unsubscribe from the digest, e-mail:
        <xsl-list-digest-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>

To post to the list, e-mail:
        <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>


----------------------------------------------------------------------
Date:   Sat, 09 Dec 2006 21:19:02 +0100
To:     xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
From:   PiGalKOM <pigalkom(_at_)poczta(_dot_)onet(_dot_)pl>
Subject: How to get cotext of foreach caller
Message-ID: <457B1A36(_dot_)2040503(_at_)poczta(_dot_)onet(_dot_)pl>

Hello,

  I have small problem:
Here is part of XML:
<parent>
      <list>
           <item>1</item>
           <item>1</item>
           <item>1</item>
           <item>1</item>
      </list>
      <child para="123">
           qwerty
     </child>
</parent>
<parent>
....
</parent>
....
And here is part of <xsl:transform version="1.0"...>

  <xsl:template match="child">
              <xsl:for-each select="/parent/list/item">
                    <xsl:value of select="?????????????/@para"/>
              </xsl:for-each>
          </form>
      </tr>     </xsl:template>

The problem is how to get value of parameter @para of <child> node (point of loop call) from for-each loop (where context is /parent/list/item )

Sorry for my "English"

Pozdrawiam,

------------------------------

Date: Sat, 9 Dec 2006 20:31:35 +0000
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
From: "Andrew Welch" <andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com>
Subject: Re: [xsl] How to get cotext of foreach caller
Message-ID: 
<74a894af0612091231s57ee0b0bn6707436efad358e9(_at_)mail(_dot_)gmail(_dot_)com>

On 12/9/06, PiGalKOM <pigalkom(_at_)poczta(_dot_)onet(_dot_)pl> wrote:
Hello,

  I have small problem:
Here is part of XML:
<parent>
      <list>
           <item>1</item>
           <item>1</item>
           <item>1</item>
           <item>1</item>
      </list>
      <child para="123">
           qwerty
     </child>
</parent>
<parent>
....
</parent>
....
And here is part of <xsl:transform version="1.0"...>


  <xsl:template match="child">
              <xsl:for-each select="/parent/list/item">
                    <xsl:value of select="?????????????/@para"/>
              </xsl:for-each>
          </form>
      </tr>     </xsl:template>

The problem is how to get value of parameter @para of <child> node
(point of loop call) from for-each loop (where context is
/parent/list/item )

Use a variable:

<xsl:template match="child">
  <xsl:variable name="this" select="."/.
  <xsl:for-each select="/parent/list/item">
    <xsl:value of select="$this/@para"/>

cheers
andrew

------------------------------

End of xsl-list Digest
***********************************

1.
Thanks Andrew for quick replay!!!

2.
I've to fix what I want (this solution is fine - I used to use it but made me tired -!!!15 variables!!!). I wish to get context of the loop caller
- I mean <child> so I could write "????magic context???/@para" in select..


cheers
Piotrek

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] Re: xsl-list Digest 10 Dec 2006 06:10:01 -0000 Issue 984, PiGalKOM <=