DaveyDonno
Programmer
Hi guys
Heres my sample xml:
Question follows after
<DocumentItem>
<BillPart>
<PresentationTypeName>Group</PresentationTypeName>
<Description>Description 1 </Description>
<Narrative>Narrative 1</Narrative>
</BillPart>
<BillPart>
<PresentationTypeName>Delete ME!!!</PresentationTypeName>
<Description>Description 2</Description>
<Narrative>Narrative 2</Narrative>
</BillPart>
<BillPart>
<PresentationTypeName>Me then 2 more</PresentationTypeName>
<Description>Description 3</Description>
<Narrative>Narrative 3</Narrative>
</BillPart>
<BillPart>
<PresentationTypeName>Bill Part</PresentationTypeName>
<Description>Description 4</Description>
<Narrative>Narrative 4</Narrative>
</BillPart>
</DocumentItem>
ok what im trying to do is output the Desciption and Narrative Concatenated together for each BillPart
Heres is what i've got so far in my transform file
<xsl:template match='DocumentItem'>
<xsl:for-each select="BillPart">
<xsl:variable name = "des" select = "//Description[current()]"/>
<xsl:variable name = "nar" select = "//Narrative[current()]"/>
<xsl:variable name = "bl" select = "concat($des,' ',$nar)"/>
<BillLine>
<xsl:value-of select="$bl"/>
</BillLine>
</xsl:for-each>
</xsl:template>
But it just pulls out the narr and description for the first billpart 4 times.
Is there some way to refer to Narr And desc nodes in the specific BillPart when it is in scope? Or any otherway of doing this?
Thanks in Advance
Dave
Heres my sample xml:
Question follows after
<DocumentItem>
<BillPart>
<PresentationTypeName>Group</PresentationTypeName>
<Description>Description 1 </Description>
<Narrative>Narrative 1</Narrative>
</BillPart>
<BillPart>
<PresentationTypeName>Delete ME!!!</PresentationTypeName>
<Description>Description 2</Description>
<Narrative>Narrative 2</Narrative>
</BillPart>
<BillPart>
<PresentationTypeName>Me then 2 more</PresentationTypeName>
<Description>Description 3</Description>
<Narrative>Narrative 3</Narrative>
</BillPart>
<BillPart>
<PresentationTypeName>Bill Part</PresentationTypeName>
<Description>Description 4</Description>
<Narrative>Narrative 4</Narrative>
</BillPart>
</DocumentItem>
ok what im trying to do is output the Desciption and Narrative Concatenated together for each BillPart
Heres is what i've got so far in my transform file
<xsl:template match='DocumentItem'>
<xsl:for-each select="BillPart">
<xsl:variable name = "des" select = "//Description[current()]"/>
<xsl:variable name = "nar" select = "//Narrative[current()]"/>
<xsl:variable name = "bl" select = "concat($des,' ',$nar)"/>
<BillLine>
<xsl:value-of select="$bl"/>
</BillLine>
</xsl:for-each>
</xsl:template>
But it just pulls out the narr and description for the first billpart 4 times.
Is there some way to refer to Narr And desc nodes in the specific BillPart when it is in scope? Or any otherway of doing this?
Thanks in Advance
Dave