[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subject: getting crlf's, but putting only lf's (i think)
From: Ray Tayek <rtayek@xxxxxxxxxxx>
Date: Sun, 02 Nov 2003 22:08:34 -0800
xsl crlf
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.