This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: csv output - carriage return help needed


What I expect from your template and MSXML, Mozilla's Transformiix and Xalan return:

CLIENT 001,

546.00,

MARGIN,

CLIENT 001,

PAGE 002,

546.00,



What you should change:

<xsl:template match="tableRow">
<xsl:for-each select="cell">
<xsl:value-of select="."/>, <xsl:text/>
</xsl:for-each>
<xsl:text>& #10;</xsl:text>
</xsl:template>

(remove the space from the line feed character reference)

Regards,

Joerg

tp001 tp wrote:
Hello,

I am using the xalan 2.3 processor.
My xml is
-------------------------------------------
<tableBody>
<tableRow>
<cell>CLIENT 001</cell>
<cell>546.00</cell>
<cell>MARGIN</cell>
</tableRow>
<tableRow>
<cell>CLIENT 001</cell>
<cell>PAGE 002</cell>
<cell>546.00</cell>
</tableRow>
-------------------------------------------

the relevant portions of the xsl are
{b4 the template decl}
<xsl:output method="text" media-type="text/plain" />
{in the xsl:template}
<xsl:for-each select="tableBody/tableRow/cell">
<pre>
<xsl:value-of select="."/>, </pre>
<xsl:text>&#xA;
</xsl:text>
</xsl:for-each>
-------------------------------------------
the output that i expect is
CLIENT 001,546.00,MARGIN,
CLIENT 001,PAGE 002,546.00,
-------------------------------------------
the actual output that i get is
CLIENT 001,546.00,MARGIN,CLIENT 001,PAGE 002,546.00,
-------------------------------------------
can someone help me out. for some reason the carriage return or the &#xA; is not working. i have searched thro the archives and this is what basically everyone is doing.

also on the side is there any site where all these odd ball xsl codes are catalogued for display.

Thanks.

TP.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]