Skip to content

Instantly share code, notes, and snippets.

@LeifW
Created October 3, 2009 21:20
Show Gist options
  • Save LeifW/200890 to your computer and use it in GitHub Desktop.
Save LeifW/200890 to your computer and use it in GitHub Desktop.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output indent="yes"/>
<xsl:param name="file" select="'example.csv'"/>
<xsl:template match="/">
<xsl:for-each select="tokenize(unparsed-text($file),'\r?\n')">
<row>
<xsl:for-each select="tokenize(.,',')">
<item>
<xsl:value-of select="."/>
</item>
</xsl:for-each>
</row>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
stylesheet -xmlns:xsl=http://www.w3.org/1999/XSL/Transform -version=2.0
output -indent=yes
param file 'example.csv'
template /
for-each tokenize(unparsed-text($file),'\r?\n')
row
for-each tokenize(.,',')
item
value-of .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment