dseaver
IS-IT--Management
- Jul 13, 2006
- 467
I have a list of legacy and current properties stored in an XML, there are 30+ properties, so I do not want to hard code each individual node possibility. I want the table to have the following structure
the properties are stored in the following format
Originally the data was in two different tables, but I need to have the values next to each other so that they can be checked against each other. Here is what I had to get each table before
I tried things like <xsl:value-of select="//Properties/@Type[.='Legacy']/name()" /> and similar others. Any help is greatly appreciated
Code:
Property name| Current | Legacy
PropA | ValueCurr|ValueLeg
Code:
<!--Bunch of other data-->
<Properties Type="Current">
<PropA>ValueCurr</PropA>
</Properties>
<Properties Type="Legacy">
<PropA>ValueLeg</PropA>
</Properties>
<!--Even more Data-->
Originally the data was in two different tables, but I need to have the values next to each other so that they can be checked against each other. Here is what I had to get each table before
Code:
<xsl:template match="Properties/@Type[.='Current']">
<fo:block break-before="page" font-size="16pt" font-weight="bold">
Properties - <xsl:value-of select="../@Type" />
</fo:block>
<fo:table border="2pt solid black">
<fo:table-column column-width="2.5in"/>
<fo:table-column column-width="2.5in"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border="1pt solid black" font-weight="bold" font-size="12pt" padding="1pt">
<fo:block>Property</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" font-weight="bold" font-size="12pt" padding="1pt">
<fo:block>Current</fo:block>
</fo:table-cell >
</fo:table-row>
<xsl:apply-templates select="../child::node()" />
</fo:table-body>
</fo:table>
</xsl:template>
<xsl:template match="Properties/child::node()">
<fo:table-row>
<fo:table-cell border="1pt solid black" padding="1pt">
<fo:block hyphenate="true"><xsl:value-of select="name()" /></fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="1pt">
<fo:block hyphenate="true"><xsl:value-of select="." /></fo:block>
</fo:table-cell >
</fo:table-row>
</xsl:template>
I tried things like <xsl:value-of select="//Properties/@Type[.='Legacy']/name()" /> and similar others. Any help is greatly appreciated