pleiades

How to export to xsl properly with commas and carriage return?

Discussion created by pleiades on Jul 25, 2017
Latest reply on Jul 26, 2017 by beverly

Hello,

 

The description exported contains commas and carriage returns

 

Whenever I try to export the records, I get a problems in the export

 

There will be rows that is blank ( I think from carriage returns)

 

and some additional columns from descriptions with commas

 

The xls I use is below.

 

Is it possible to include both commas and carraige return to the xls?

 

Thank you!

 

<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet xmlns:fmp="http://www.filemaker.com/fmpxmlresult"
exclude-result-prefixes="fmp" version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">

<!-- Header line, inserted only once; if not desired, remove -->
<xsl:text>Name,Address,Birthday,Description,Status&#13;</xsl:text>

<xsl:for-each select="fmp:FMPXMLRESULT/fmp:RESULTSET/fmp:ROW">
<xsl:variable name="posRow" select="position()"/>
<xsl:variable name="lastRow" select="last()"/>
<xsl:for-each select="fmp:COL/fmp:DATA">
<xsl:value-of select="."/>
<xsl:choose>
<xsl:when test="position()!=last()">
<xsl:text>,</xsl:text>
</xsl:when>
<xsl:when test="position()=last() and $posRow!=$lastRow">
<xsl:text>&#13;</xsl:text>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>

</xsl:template>
</xsl:stylesheet>

 

 

Update1: I made a mistake, it should be xsl not xls

Update2: The FMP is v14 and on Windows 7

Outcomes