|
next
|
Subject: extra carriage returns in "csv" output from xslt Author: alec eiffel Date: 09 Mar 2009 11:46 AM
|
Hi there,
I'm using this XSL to process an XML file that I eventually want in CSV.
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="no" method="text"/>
<xsl:template match="nC">
<xsl:text disable-output-escaping="yes">"</xsl:text>
<xsl:value-of select="normalize-space(id)"/>
<xsl:text disable-output-escaping="yes">"</xsl:text>
<xsl:text disable-output-escaping="yes">,</xsl:text>
<xsl:text disable-output-escaping="yes">"</xsl:text>
<xsl:value-of select="normalize-space(name)"/>
<xsl:text disable-output-escaping="yes">"</xsl:text>
</xsl:template>
</xsl:stylesheet>
And I am getting this output:
"01","basic"
"02","task1 bundle"
"03","task2 bundle"
"04","task1 family"
Where the carriage returns between lines are extra, and need to be suppressed. The spaces at the beginning of lines need to be suppressed in the CSV output, which I want to look like:
"01","basic"
"02","task1 bundle"
"03","task2 bundle"
"04","task1 family"
Can anyone see what I am doing wrong here? Thanks for the input!!
alec
|
|
|