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

Re: Using xsl:for-each for every 2 elements ?

Subject: Re: Using xsl:for-each for every 2 elements ?
From: Ahsan Ali <doubleletter@xxxxxxxxx>
Date: Tue, 31 May 2005 09:22:24 +0400
Re:  Using xsl:for-each for every 2 elements ?
Thanks Mukul.

In this case, how do I refer to the _two_ elements selected.. Using
'.', I can display only the second element...

Regards,

Ahsan

On 5/31/05, Mukul Gandhi <mukul_gandhi@xxxxxxxxx> wrote:
> Hi Ahsan,
>    Please try this XSL, for processing every two
> elements ..
>
>    <xsl:for-each select="//*[(position() mod 2) = 0]">
>      <!-- Processing you wish -->
>    </xsl:for-each>
>
> Regards,
> Mukul
>
> --- Ahsan Ali <doubleletter@xxxxxxxxx> wrote:
> > Hi,
> >
> > Is it possible to use xsl:for-each for every two
> > elements ?
> >
> > E.g
> > ----------
> > <data>
> >   <flights>
> >    <flt>onward</flt>
> >    <flt>return</flt>
> >    <flt>onward</flt>
> >    <flt>return</flt>
> >   </flights>
> >
> >  <availability>
> >   <avail>N</avail>
> >   <avail>Y</avail>
> >   <avail>N</avail>
> >   <avail>Y</avail>
> >   </availability>
> >
> > </data>
> > --------
> > The second part of the problem is that, the above
> > have to be
> > iterated/grouped using a method that would still
> > allow me to somehow
> > co-relate the first <avail> in <availability> with
> > the first <flt> in
> > <flights>. That's my second question.. how to
> > co-relate that since
> > their in the same level of hierarchy  ??
> >
> > Thanks,
> >
> > Ahsan
> >
> >
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com

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.