Subject: AW: Formatting XSL for XML to CSV translation
From: "Hendrik Beck \(Computation SIS GmbH\)" <hendrik.beck@xxxxxxxxxxxxxxxxxx>
Date: Thu, 18 Sep 2003 17:04:46 +0200
|
Dear Stuart,
Try to put the commata between the elements in an text element:
<xsl:text>,</text>
This should work, but it isn't yet the best for readability.
Best wishes
Hendrik
> -----Ursprüngliche Nachricht-----
> Von: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von
> Stuart Jones
> Gesendet: Donnerstag, 18. September 2003 16:47
> An: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Betreff: Formatting XSL for XML to CSV translation
>
>
> Dear xsl-list
>
> I am new to XSL and have been playing for a few days, using
> for my education the web (brilliant tool that it is). I want
> to use XSL to transform an XML document (generated by the
> ADODataSet.SaveToFile() method) into CSV format. All pretty
> straightforward for a novice, and I've achieved what I'm
> after - but I have an aesthetic question.
>
> For readability I would prefer the XSL file to look nicely
> nested like this:
>
> <xsl:variable name="new_line" select="'
'"/>
> <xsl:template match="/">
>
> <xsl:for-each select="xml/rs:data/z:row">
> <xsl:value-of select="@field1"/>,
> <xsl:value-of select="@field2"/>,
> ...
> <xsl:value-of select="@fieldn"/>
> <xsl:value-of select="$new_line"/>
> </xsl:for-each>
>
> </xsl:template>
>
> Unfortunately, this means that each value ends up on its own
> line. Placing each element in one long line in the XSL solves
> the problem but is hard to read (to say the least).
>
> Any ideas?
>
> Thanks
> Stuart
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|