Game Development Reference
In-Depth Information
<xsl:output indent="yes" />
<xsl:template match="/">
<songlist>
<xsl:apply-templates select="plist/dict/dict/dict"/>
</songlist>
</xsl:template>
<xsl:template match="dict">
<song>
<xsl:apply-templates select="key"/>
</song>
</xsl:template>
<xsl:template match="key">
<xsl:element name="{translate(text(),
_ ￿ )}">
<xsl:value-of select="following-sibling::node()[1]"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
,
Listing 12.16. iTunes XSLT document (iTunesTransform.xsl).
You will get something more digestible using xslt.exe , iTunesTransform.xsl ,
iTunesLibrary.xml ,and iTunesXformed.xml (see Listing 12.17).
<?xml version="1.0" encoding="utf-8"?>
<songlist>
<song>
<Track_ID>79</Track_ID>
<Name>Air Swell Intro</Name>
<Artist>Chiddy Bang</Artist>
<Album_Artist>Chiddy Bang</Album_Artist>
<Composer>Xaphoon Jones</Composer>
<Album>Air Swell</Album>
<Genre>Hip Hop</Genre>
<Kind>MPEG audio file</Kind>
<Size>1681866</Size>
<Total_Time>34977</Total_Time>
<Disc_Number>1</Disc_Number>
<Disc_Count>1</Disc_Count>
<Track_Number>1</Track_Number>
<Track_Count>6</Track_Count>
<Year>2010</Year>
<BPM>110</BPM>
<Date_Modified>2010-04-06T20:08:06Z</Date_Modified>
<Date_Added>2010-08-01T23:50:26Z</Date_Added>
<Bit_Rate>320</Bit_Rate>
<Sample_Rate>44100</Sample_Rate>
<Part_Of_Gapless_Album>
</Part_Of_Gapless_Album>
Listing 12.17. Transformed iTunes Library XML document (iTunesXformed.xml).
Search WWH ::




Custom Search