dseaver
IS-IT--Management
- Jul 13, 2006
- 467
I have a table I am populating, and I have the left cell always being populated with the name of a call, and the right cell being filled with files the calls are in. I want to have it so that if there is a filename in the right, the row is white, otherwise it is gray. I have this working with a similar situation, so I used similar code, by the condition for color or white is slightly different. Here is the Data that is in the XML.
And here is the XSL I have now:
I know the problem is in my If statement, I don't know exactly what it should be
Code:
<Function Call="Call1">
<File>FileB</File>
</Function>
<Function Call="Call1">
<File>FileA</File>
<File>FileB</File>
</Function>
<Function Call="Call1">
<File />
</Function>
<Function Call="Call1">
<File />
</Function>
And here is the XSL I have now:
Code:
<xsl:template match="Function">
<xsl:if test="File = n">
<fo:table-row>
<fo:table-cell border="1pt solid black" background-color="#CCCCCC">
<fo:block> <xsl:value-of select="@Call"/></fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" background-color="#CCCCCC">
<xsl:apply-templates select="File" />
</fo:table-cell>
</fo:table-row>
</xsl:if>
<xsl:if test="not(File = n)">
<fo:table-row>
<fo:table-cell border="1pt solid black" background-color="#CCCCCC">
<fo:block> <xsl:value-of select="@Call"/></fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" background-color="#CCCCCC">
<xsl:apply-templates select="File" />
</fo:table-cell>
</fo:table-row>
</xsl:if>
</xsl:template>
<xsl:template match="File">
<fo:block>
<xsl:value-of select="." />
</fo:block>
</xsl:template>
I know the problem is in my If statement, I don't know exactly what it should be