This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Selecting a set of nodes


> I´m working with the following source:
>     <d size-d="500">
>         <c id="1" size-c="114"/>
>         <c id="2" size-c="116"/>
>         <c id="3" size-c="113"/>
>         <c id="4" size-c="121"/>
>         <c id="5" size-c="115"/>
>         <c id="6" size-c="111"/>
>         <c id="7" size-c="123"/>
>     </d>
>
> I want to display:
>     1
>     2
>     3
>     4
> the id attribute of the c nodes that the sum of the size-c
> attribute be
> equal or less than the size-d attribute. How can I do??

<xsl:for-each select="c[sum(@size-c | preceding-sibling::c/@size-c) &lt;=
../@size-d]">
  <xsl:value-of select="@id"/>&#xa0;
</xsl:for-each>

Mike Kay


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]