I have the following XML document:
Shockwave
Ruby
<
This CsvEscape function is XSLT 1.0 and escapes column values ,, ", and newlines like RFC 4180 or Excel. It makes use of the fact that you can recursively call XSLT templates:
EscapeQuotes replaces all double quotes with 2 double quotes, recursively from the start of the string.CsvEscape checks if the text contains a comma or double quote, and if so surrounds the whole string with a pair of double quotes and calls EscapeQuotes for the string.Example usage: xsltproc xmltocsv.xslt file.xml > file.csv
""
"
"
"
"
"
"
project,name,language,owner,state,startDate
,
,
,
,