LISTSERV mailing list manager LISTSERV 15.5

Help for XML-L Archives


XML-L Archives

XML-L Archives


View:

Next Message | Previous Message
Next in Topic | Previous in Topic
Next by Same Author | Previous by Same Author
Chronologically | Most Recent First
Proportional Font | Monospaced Font

Options:

Join or Leave XML-L
Reply | Post New Message
Search Archives


Subject: Using XSLT to make a CSV file
From: Jonathan Duncan <[log in to unmask]>
Reply-To:General discussion of Extensible Markup Language <[log in to unmask]>
Date:Sat, 8 Jul 2006 12:38:45 -0600
Content-Type:TEXT/PLAIN
Parts/Attachments:
Parts/Attachments

TEXT/PLAIN (34 lines)


I have been trying to figure out how to make this FileMaker Pro XSLT file 
work to make a CSV file:

http://nacnud.com/xml/export2csv.xslt

It is currently close to  what I need but there are problems.  It will put 
a comma (&#44;) after ever column title, which is what I want, but it also 
puts one after the last title, which I do not want.  It will do the same 
with every field in each row.  A comma after each, good, a comma after the 
last field in each row, bad.

I also need to encapsulate each field in double-quotes while also escaping 
existing double-quotes that are in the field contents.

To do the encapsulation I think I can just change this:

<xsl:value-of select="."/>
<xsl:text>&#44;</xsl:text>

...to this:

<xsl:text>&#34;</xsl:text>
<xsl:value-of select="."/>
<xsl:text>&#34;&#44;</xsl:text>

Right?

But then how to lose the comma from the last field and escape the double 
quotes in the field contents?

Help?

Thanks,
Jonathan

Back to: Top of Message | Previous Page | Main XML-L Page

Permalink



LISTSERV.HEANET.IE

CataList Email List Search Powered by the LISTSERV Email List Manager