Subject:Reaching element within same parent (Newbie?) Author:(Deleted User) Date:18 Jun 2007 08:06 AM
Hi Piet,
the context of the XSLT snippet you have is the parent node of subrecord (as you are doing <xsl:if test="subrecord/name='txt_Country'">), so you should write <xsl:value-of select="subrecord/value"/>
Subject:Reaching element within same parent (Newbie?) Author:Piet Hein Date:18 Jun 2007 08:48 AM
Unfortunately /subrecord/value exists multiple times in the source XML, I need the one in the subrecord where name = 'txt_Country'. Your solution only addresses the first /subrecord/value in the source.
Subject:Re: Reaching element within same parent (Newbie?) Author:(Deleted User) Date:18 Jun 2007 09:06 AM
Hi Piet,
in this case your entire xsl:if is wrong, as it will always return
'true' if there is at least one subrecord that has a name equal to
'txt_Country'.
You will need to add a loop on subrecord, and remove the 'subrecord'
part from both the xsl:if and xsl:value-of. You will have to decide
where the loop needs to be (before the COL element or before the DATA
element, or even before)