|
[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)
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 </xsl:text> <xsl:apply-templates/> </xsl:template> <xsl:template match="outputRows/outputRow"> <xsl:apply-templates/> <xsl:text> </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
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








