I'm trying to patch my .ODT document (change values in table) with xslt. I know how to change value of only one cell in table, but how to fill whole column?
This is example how to change one value from the table (row=3, col=3)
<xsl:template match="table:table[@table:name='1 level']/table:table-row[position()=3]/table:table-cell[position()=3]">
<xsl:apply-templates select="." mode="replace">
<xsl:with-param name="value" select="TEST"/>
</xsl:apply-templates>
</xsl:template>
Before patching:
A B C
--- --- --- ---
1 1 1 1
2 1 1 1
3 1 1 1
4 1 1 1
After patching:
A B C
--- --- --- ------
1 1 1 1
2 1 1 1
3 1 1 TEST
4 1 1 1
How fill whole column by changing data in loop? I have xml list, that comes from file by <xsl:variable name="data" select="document('template.xml')/root"/>:
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<marketDatas>
<marketData>
<countDeals>10</countDeals>
</marketData>
<marketData>
<countDeals>20</countDeals>
</marketData>
<marketData>
<countDeals>30</countDeals>
</marketData>
</marketDatas>
<root>
and want change row C1-C3 by value from marketDatas list.
Expected output:
A B C
--- --- --- --------
1 1 1 10
2 1 1 20
3 1 1 30
4 1 1 1