Posted By

koncept on 01/16/07


Tagged

xml apple XSL itunes transform


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

basicmagic
enajenkins
deanburge


Transform iTunes Music Library XML


 / Published in: XML
 

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version = "1.0"
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  4. <xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>
  5.  
  6. <xsl:template match="/">
  7. <songlist>
  8. <xsl:apply-templates select="plist/dict/dict/dict"/>
  9. </songlist>
  10. </xsl:template>
  11.  
  12. <xsl:template match="dict">
  13. <song>
  14. <xsl:apply-templates select="key"/>
  15. </song>
  16. </xsl:template>
  17.  
  18. <xsl:template match="key">
  19. <xsl:element name="{translate(text(), ' ', '_')}">
  20. <xsl:value-of select="following-sibling::node()[1]"/>
  21. </xsl:element>
  22. </xsl:template>
  23. </xsl:stylesheet>

Report this snippet  

You need to login to post a comment.