Skip to content

Instantly share code, notes, and snippets.

@thcipriani
Created February 13, 2012 21:39
Show Gist options
  • Save thcipriani/1820699 to your computer and use it in GitHub Desktop.
Save thcipriani/1820699 to your computer and use it in GitHub Desktop.
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version='2.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method='text'/>
<xsl:template match = "/icestats" >
{"song":
<xsl:for-each select='source'>
&quot;<xsl:value-of select="@mount" />&quot;: {
&quot;name&quot; : &quot;<xsl:value-of select="name"/>&quot;,
&quot;listeners&quot; : &quot;<xsl:value-of select="listeners" />&quot;,
&quot;description&quot; : &quot;<xsl:value-of select="description" />&quot;,
&quot;artist&quot; : &quot;<xsl:value-of select="artist" />&quot;,
&quot;metadata&quot; : <xsl:value-of select="title" />,
&quot;genre&quot; : &quot;<xsl:value-of select="genre" />&quot;,
&quot;url&quot; : &quot;<xsl:value-of select="url" />&quot;
}
}
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment