xml version encoding UTF-8 xsl stylesheet version xmlns xsl http www w

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<item>
<xsl:attribute name="id">
<xsl:value-of select="/release/@id" />
</xsl:attribute>
<type>Album</type>
<name><xsl:value-of select="/release/title" /></name>
<artist><xsl:value-of select="/release/album/artist" /></artist>
<genre><xsl:value-of select="/release/genre" /></genre>
<rights>
<xsl:for-each select="/release/album/rights-holders/rights-holder">
<holder>
<type>
<xsl:if test="@type='owner'">
Author
</xsl:if>
<xsl:if test="@type='label'">
Label
</xsl:if>
</type>
<name><xsl:value-of select="."/></name>
<percentage><xsl:value-of select="@percentage"/></percentage>
</holder>
</xsl:for-each>
</rights>
</item>
<xsl:for-each select="/release/tracks/track">
<item>
<xsl:attribute name="id">
<xsl:value-of select="@id" />
</xsl:attribute>
<xsl:attribute name="parent_id">
<xsl:value-of select="/release/@id" />
</xsl:attribute>
<type>Realfulltone</type>
<title><xsl:value-of select="title" /></title>
<artist><xsl:value-of select="/release/album/artist" /></artist>
<album><xsl:value-of select="/release/title" /></album>
<genre><xsl:value-of select="/release/genre" /></genre>
<provider><xsl:value-of select="/release/provider" /></provider>
<duration><xsl:value-of select="duration" /></duration>
<data>
<variant>
<url><xsl:value-of select="file/@url" /></url>
<format><xsl:value-of select="/release/format/@type" /></format>
<bit_rate><xsl:value-of select="/release/format/bit-rate" /></bit_rate>
</variant>
</data>
</item>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>