[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: embedded <xsl-for-each>

Subject: Re: embedded <xsl-for-each>
From: "Robert Koberg" <rob@xxxxxxxxxx>
Date: Thu, 21 Feb 2002 07:31:27 -0800
xsl for each embedded
or even cleaner:

<xsl:template match="FLOW-MENU-GRP">
     <xsl:apply-templates/>
</xsl:template>

<xsl:template match="FAMILY">
     <DIV ID="oFamily{position()}">
        <xsl:value-of select="."/>
      </DIV>
</xsl:template>

<xsl:template match="SERVICE">
     <DIV ID="oService{position()}">
        <xsl:value-of select="."/>
      </DIV>
</xsl:template>

best,
-Rob

----- Original Message -----
From: "Sébastien Tisserant" <stisserant@xxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>; <awelch@xxxxxxxxxxxxxxx>
Sent: Thursday, February 21, 2002 6:55 AM
Subject: RE:  embedded <xsl-for-each>


> the template was simplified:
>
> <xsl:template match="FLOW-MENU-GRP">
>     <xsl:for-each
> select="/FLOW-MENU-GRP/FAMILY">
>       <DIV>
>         <xsl:attribute
> name="ID">oFamily<xsl:value-of select="position()"/></xsl:attribute>
> <xsl:value-of select="text()"/>
>       </DIV>
>             <xsl:for-each
> select="/FLOW-MENU-GRP/SERVICE">
>               <DIV>
> <xsl:attribute name="ID">oFamhere i'd like to get the value of position()
given
> above in line 4</xsl:attribute>
>                <xsl:value-of
> select="text()"/>
>
>              </DIV>
>            </xsl:for-each>
> </xsl:for-each>
> </xsl:template>
>
> Sorry for the misunderstanding,
>
> Sébastien
>
>
>
>
>
>
> >>> awelch@xxxxxxxxxxxxxxx 02/21/02 03:05 >>>
>
> Hi,
>
> Which value are you after?  As you use <xsl:for-each> to step through each
> /FLOW-MENU-GRP/FAMILY, and then a another <xsl:for-each> to step though
each
> /FLOW-MENY-GRP/SERVICE, its not clear why you could not use position() on
> the 'service' elements to give you the same id number as that of the
> 'family' elements.  If the number of each of type of element differs, what
> id number would you want then?
>
> If you post some sample data and the kind of result you are looking for,
> then your requirements will become clearer.
>
> cheers
>
> andrew
>
> ===
>
>
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Sébastien
> Tisserant
> Sent: Thursday, February 21, 2002 1:24 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  embedded <xsl-for-each>
>
>
> hello
>
> i have this template:
>
> <xsl:template match="FLOW-MENU-GRP">    <xsl:for-each
> select="/FLOW-MENU-GRP/FAMILY">      <DIV>        <xsl:attribute
> name="ID"><xsl:value-of select="position()"/></xsl:attribute>
> <xsl:value-of select="text()"/>      </DIV>            <xsl:for-each
> select="/FLOW-MENU-GRP/SERVICE">              <DIV>
> <xsl:attribute name="ID">here i'd like to get the value of position()
given
> above in line 4</xsl:attribute>               <xsl:value-of
> select="text()"/>
>              </DIV>           </xsl:for-each>
> </xsl:for-each></xsl:template>
>
> is this possible using and ancestor path? how should i write it?
>
> is this possible using <xsl:variable>? how should i use it?
>
> thanks
>
> sébastien
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.325 / Virus Database: 182 - Release Date: 2/19/02
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.325 / Virus Database: 182 - Release Date: 2/19/02
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.