[xsl] getting crlf's, but putting only lf's (i think)

Subject: [xsl] getting crlf's, but putting only lf's (i think)
From: Ray Tayek <rtayek@xxxxxxxxxxx>
Date: Sun, 02 Nov 2003 22:08:34 -0800
hi, i get crlf's in my transformed output when using the following (see below). i am trying to convert an xml file into a csv file. all is well except that xalan-j_2_5_1 is putting crlf's into the output stream (doesn't matter whether it's a writer or a byte output stream). is there any way to get rid of the carriage return?

any pointers will be appreciated.

thanks

input xml file:

<?xml version="1.0" encoding="UTF-8"?>
<outputRows>
<outputRow>
<inputRecordSequenceNumber>1</inputRecordSequenceNumber>
<copy1>copy1Value1</copy1>
<renamed1>rename1Value1</renamed1>
<new1>new1ValueFromSpecial1Name</new1>
<new2>new2ValueFromSpecial1Name</new2>
<new3>special1Value1</new3>
</outputRow>
<outputRow>
<inputRecordSequenceNumber>1</inputRecordSequenceNumber>
<copy1>copy1Value1</copy1>
<renamed1>rename1Value1</renamed1>
<new1>new1ValueFromSpecial2Name</new1>
<new2>new2ValueFromSpecial2Name</new2>
<new3>special2Value1</new3>
</outputRow>
<outputRow>
<inputRecordSequenceNumber>2</inputRecordSequenceNumber>
<copy1>copy1Value2</copy1>
<renamed1>rename1Value2</renamed1>
<new1>new1ValueFromSpecial1Name</new1>
<new2>new2ValueFromSpecial1Name</new2>
<new3>special1Value2</new3>
</outputRow>
<outputRow>
<inputRecordSequenceNumber>2</inputRecordSequenceNumber>
<copy1>copy1Value2</copy1>
<renamed1>rename1Value2</renamed1>
<new1>new1ValueFromSpecial2Name</new1>
<new2>new2ValueFromSpecial2Name</new2>
<new3>special2Value2</new3>
</outputRow>
</outputRows>

xslt file:

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="text"/>
<xsl:strip-space elements="outputRows outputRows/outputRow"/>
<xsl:template match="outputRows">
<xsl:text>inputRecordSequenceNumber,copy1,remove1,rename1,special1,special2&#10;</xsl:text>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="outputRows/outputRow">
<xsl:apply-templates/>
<xsl:text>&#10;</xsl:text>
</xsl:template>
<xsl:template match="outputRows/outputRow/*">
<xsl:value-of select="."/><xsl:if test="position() != last()">,</xsl:if>
</xsl:template>
</xsl:stylesheet>


output file:

inputRecordSequenceNumber,copy1,remove1,rename1,special1,special2
1,copy1Value1,rename1Value1,new1ValueFromSpecial1Name,new2ValueFromSpecial1Name,special1Value1
1,copy1Value1,rename1Value1,new1ValueFromSpecial2Name,new2ValueFromSpecial2Name,special2Value1
2,copy1Value2,rename1Value2,new1ValueFromSpecial1Name,new2ValueFromSpecial1Name,special1Value2
2,copy1Value2,rename1Value2,new1ValueFromSpecial2Name,new2ValueFromSpecial2Name,special2Value2




--- ray tayek http://tayek.com/ actively seeking mentoring or telecommuting work vice chair orange county java users group http://www.ocjug.org/ hate spam? http://samspade.org/ssw/


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread