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

Re: Selecting a subset of siblings using following-sib

Subject: Re: Selecting a subset of siblings using following-sibling
From: "cutlass" <cutlass@xxxxxxxxxxx>
Date: Fri, 23 Nov 2001 18:48:08 -0000
xslt following sib
hmmm,

----- Original Message -----
From: "Liat Jacob" <jacob_liat@xxxxxxxxxxx>


> Hello,
>
> I have an XML file that looks like this:
>
> <DETAIL>
>   <A>text</A>
>   <B>text</B>
>   <C>text</C>
>   <D>text</D>
>   <E>text</E>
>   <F>text</F>
>   <G>text</G>
> </DETAIL>
>
> I need to extract the nodes B through D. I have tried to do this using:
>

it looks like u want to do a classic ' for a=1 to 5 ' loop,

my question is 'do u really need to do this' ?

otherwise take a look here for a classic xslt way of doing it

http://www.informatik.hu-berlin.de/~obecker/XSLT/loop-compiler/


cheers, jim fuller

> <xsl:for-each select="child::B/following-sibling::*[(name(.) != 'E')]">
>    do something here...
> </xsl:for-each>
>
> but I seem to be getting the nodes B, C, D, F and G (which is not
desirable,
> since I only need nodes B, C and D).  I'm not sure if this is the right
> (read elegant) approach, but I can't figure out another way to select a
> subset of nodes and define its boundaries (i.e., is it possible to define
> the boundaries as 'upper' and 'lower' limits with node B being the 'lower'
> limit and node D the 'upper' limit?).
>
> Thanks in advance for any advice/suggestions.
>
> Regards,
> Liat
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
>  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.