I imported data from a .csv
file, added some columns with computed values and wanted to export the data from each row to a custom xml format.
I created a xslt
file, added it to the filters and ran the test.
It produces a xml file but with empty data where the table:table-row
data is supposed to be.
I appended a test xslt
file that I used that also doesn’t get any table rows.
I know that that’s html, but it’s just for testing and produces the same non-results as my other .xslt file.
So I assume that some setting with my Calc has to be wrong.
Any ideas?
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
exclude-result-prefixes="table text"
>
<xsl:output
method="xml"
indent="yes"
encoding="UTF-8"
omit-xml-declaration="no"
/>
<xsl:template match="/">
<html>
<body>
<table>
<xsl:for-each select="//table:table-row">
<xsl:if test="position() > 1">
<tr>
<td>
First Column Value
</td>
<td>
<xsl:value-of select="table:table-cell[1]/text:p" />
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
The output I get:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<body>
<table/>
</body>
</html>