dseaver
IS-IT--Management
- Jul 13, 2006
- 467
I have a table where either 2 or 3 columns are going to be filled, but there are 2 types of nodes filling them. The first two columns are the first type (A) and the third column is the second type(A). The input into the row is either 2A, 1A 1B, or 2A 1B. I want B in the third column regardless. The first cell in the Table will always be populated. I have conditional labeling of the cells right now.
Here is the XSL so far for the cells
And here is the XML structure
THe output would be
Thanks!
Here is the XSL so far for the cells
Code:
<xsl:for-each select="Child">
<fo:table-cell border="1pt solid black">
<xsl:if test="string(TypeA/@Number)">
<fo:block> <xsl:value-of select="Name"/></fo:block>
<fo:block><xsl:value-of select="TypeA/@Number"/></fo:block>
</xsl:if>
<xsl:if test="string(TypeB/@Number)">
<fo:block> <xsl:value-of select="Name"/></fo:block>
<fo:block><xsl:value-of select="TypeB/@Number"/></fo:block>
</xsl:if>
</fo:table-cell>
</xsl:for-each>
And here is the XML structure
Code:
<Parent>
- <Child>
<Name>Cell A</Name>
<TypeA Number="6" />
</Child>
- <Child>
<Name>Cell B</Name>
<TypeA Number="4" />
</Child>
</Parent>
- <Parent>
- <Child>
<Name>Cell C</Name>
<TypeA Number="9" />
</Child>
- <Child>
<Name>Cell D</Name>
<TypeB Number="4" />
</Child>
</Parent>
THe output would be
Code:
|Column 1|Column 2| Column3|
|Cell A |Cell B | |
|Cell C | |Cell D |
Thanks!