Re: [xsl] nested for-each to create a html table

Subject: Re: [xsl] nested for-each to create a html table
From: "Aron Bock" <aronbock@xxxxxxxxxxx>
Date: Thu, 19 May 2005 13:21:21 +0000
Santosh,

I am currently using this method, but wanted to loop through Columns
node as i need to get other informations like dataType,colSelected
etc.. i will be using these to format the column.

> ... If you want to be more specific about "columns"
> printed, use
> position() in the inner loop to relate to @id in the metadata.
>
> There was another post today (by Martie ...) about just this issue
> of
> matching row data with its metadata.

<xsl:template match="/">
<xsl:for-each select="Results/Rows/Row">
<xsl:for-each select="*">
<xsl:variable name="pos" select="position()"/>
<xsl:variable name="meta-col" select="/Results/Columns/Column[@indx = $pos - 1]"/>
<xsl:value-of select="concat($meta-col/colName, ':')"/>
<xsl:value-of select="."/>
<xsl:text> </xsl:text>
</xsl:for-each>
<xsl:text>&#xa;</xsl:text>
</xsl:for-each>
</xsl:template>


Regards,

--A

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee. Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


Current Thread