Code:
<passengergroup>
<passengerList>
<passDetails>
<route>LONDON</route>
<lastname>RAY</lastname>
</passDetails>
<seatDetails>
<SeatNo>1A</SeatNo>
</seatDetails>
<customervalue>good</customervalue>
</passengerList
<passengerList>
<passDetails>
<route>LONDON</route>
<lastname>RAY</lastname>
</passDetails>
<seatDetails>
<SeatNo>1B</SeatNo>
</seatDetails>
<customervalue>good</customervalue>
</passengerList
<passengerList>
<passDetails>
<route>DELHI</route>
<lastname>RAY</lastname>
</passDetails>
<seatDetails>
<SeatNo>2C</SeatNo>
</seatDetails>
<customervalue>okey</customervalue>
</passengerList>
<passengerList>
<passDetails>
<route>DELHI</route>
<lastname>RAY</lastname>
</passDetails>
<seatDetails>
<SeatNo>2D</SeatNo>
</seatDetails>
<customervalue>okey</customervalue>
</passengerList>
</passengergroup>
XSLT CODE
Code:
<xsl:for-each select="passengergroup/passengerList">
<xsl:if test="customervalue='good'
<xsl:value-of select="route"/><xsl:text> </xsl:text>
<xsl:value-of select="customervalue"/><xsl:text> </xsl:text>
<xsl:value-of select="seatDetails/SeatNo"/>
</for-each>
<xsl:for-each select="passengergroup/passengerList">
<xsl:if test="customervalue='okey'
<xsl:value-of select="route"/><xsl:text> </xsl:text>
<xsl:value-of select="customervalue"/><xsl:text> </xsl:text>
<xsl:value-of select="seatDetails/SeatNo"/>
</for-each>
It will produce output like this
LONDON good 1A
LONDON good 1B
DELHI okey 2C
DELHI okey 2D
But i need the output like this
LONDON good 1A 1B
DELHI okey 2C 2D
Here am getting LONOND
I dont want to print the LONDON and DELHI again and again for the corresponding seats. if the route has multiple seat It has to come to like this
LONDON AB 1A 1B 1C 1D 2B 2F 3F 3G ........ Please help me..Really I tried lot..I am unable to do that..It might be silly question to you. But I dont know..answer this.