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

Re: Question: Pairing sibling nodes

Subject: Re: Question: Pairing sibling nodes
From: Ahsan Ali <doubleletter@xxxxxxxxx>
Date: Tue, 15 Nov 2005 16:24:38 +0400
Re:  Question: Pairing sibling nodes
Thank you Jarno. This works.

Cheers,

Ahsan

On 11/15/05, Jarno.Elovirta@xxxxxxxxx <Jarno.Elovirta@xxxxxxxxx> wrote:
> Hi,
>
> >I have an xml fragment as following:
> >
> ><PNR>
> >
> > <LNameInfo>
> >   <LName>A.</LName>
> > </LNameInfo>
> >
> ><LNameInfo>
> >   <LName>Smith</LName>
> > </LNameInfo>
> >
> ><LNameInfo>
> >   <LName>Johnson</LName>
> > </LNameInfo>
> >
> ><FNameInfo>
> >   <FName>Ahsan</LName>
> > </FNameInfo>
> >
> ><FNameInfo>
> >   <FName>Brad</FName>
> > </FNameInfo>
> >
> ><FNameInfo>
> >   <FName>Dave</FName>
> > </FNameInfo>
> >
> ></PNR>
> >
> >I need to print the first Lname with the first Fname, and the
> >second with the second, and so on.
>
> <xsl:for-each select="LNameInfo">
>   <xsl:variable name="i" select="position()"/>
>   <xsl:value-of select="LName"/>
>   <xsl:text> </>
>   <xsl:value-of select="../FNameInfo[position() = $i]/FName"/>
> </>
>
> Jarno
>
>


--
Muted Musings - http://doubleletter.blogspot.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.