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

AW: Formatting XSL for XML to CSV translation

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
xml to csv translator
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="'&#013;'"/>
>   <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


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.