[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Dynamically creating XPath expressions Help required

Subject: [xsl] Dynamically creating XPath expressions Help required
From: <cheburashka@xxxxxxxxxx>
Date: Fri, 2 Apr 2004 14:15:23 +1200

Hi my name is adam, I got your email address from the google search. I hpoe you do not mind me contacting you directly.But I need help with some xslt.

I am constructing a table, Each GridBody0 - GridBody n
node set represents a single row of the table.Each Gridbody tag included a number of Col0 - Col n tags
these represent each cell of the row.

The problem is that each cell that is rendered must be conditionally formatted.Tags that need to be formatted are
include within the gridcolors section of the xml document.


 The idea is to use a for-each loop to go through each
 set of gridbody tags to render them. As I do this I
want to construct a path query to determine if the current cell is turned green 

 <Grid0Row0Col3LimeGreen> if this exist then green. 

The question is how


<xsl:for-each select="Reports/GridBody0">

     <xsl:if test="Col3 != ''" > 
	<xsl:variable name="rowNo" select="concat('../GridColors/Grid0RowNo',RowNo,'Col3LimeGreen')"></xsl:variable> 
	       <!--If this element exist and we have to render green-->
		     <xsl:when test="$rowNo = 1" >-->
		        <td align="right" width="60"  bordercolor="DarkGray" border="1" bgcolor="LimeGreen">
			   <font style='FONT-WEIGHT: normal;Font-Size:XX-Small; COLOR: Black; FONT-FAMILY:Verdana'>      
			       <xsl:value-of select="format-number(Col3,'#,##0.#')"></xsl:value-of>



    <MemberUniqueName>[Product].[All Products].[Consumer  Electronics]</MemberUniqueName>
    <MemberCaption>Consumer Electronics</MemberCaption>
    <MemberUniqueName>[Product].[All Products].[Domestic Whiteware]</MemberUniqueName>
    <MemberCaption>Domestic Whiteware</MemberCaption>

<%@ OutputCache Duration="60" VaryByParam="none"%>

Current Thread