<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes">
<xsl:output version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="no" media-type="text/html" />
<xsl:template  name="Process">  
   <xsl:param  name="text"  />  
   <xsl:choose>  
           <xsl:when  test="contains($text,'&#10;')">  
                       <xsl:value-of  select="substring-before($text,'&#10;')"  /><br  />  
                           <xsl:call-template  name="Process">  
                                <xsl:with-param  name="text"  select="substring-after($text,'&#10;')"  />  
                           </xsl:call-template>  
           </xsl:when>  
           <xsl:otherwise>  
                       <xsl:value-of  select="$text"  />  
           </xsl:otherwise>  
</xsl:choose>  
</xsl:template>
    <xsl:template match="/">
        <html>
            <head>
                <title />
            </head>
            <body>
                <xsl:for-each select="Track">
                    <xsl:for-each select="Artist">
                        <span style="font-weight:bold; ">
                            <xsl:apply-templates />
                        </span>
                    </xsl:for-each>
                </xsl:for-each>
                <br />
                <xsl:for-each select="Track">
                    <xsl:for-each select="Title">
                        <xsl:apply-templates />
                    </xsl:for-each>
                </xsl:for-each>
                <br />
                <span style="font-size:x-small; font-weight:bold; "> Length&#160; </span>
                <xsl:for-each select="Track">
                    <xsl:for-each select="Length">
                        <span style="color:#808080; font-family:Courier New; font-size:smaller; font-style:italic; ">
                            <xsl:apply-templates />
                        </span>
                    </xsl:for-each>
                </xsl:for-each>
                <br />
                <span style="color:#808080; font-size:smaller; ">&#160;</span>
		<a>
                    <xsl:attribute name="href"><xsl:text disable-output-escaping="yes">http://cdlibx/action/EditTrack.xml#</xsl:text><xsl:value-of select="Track/TrackID" /></xsl:attribute>
                    <span style="color:#C0C0C0; font-family:Courier New; font-size:smaller; font-weight:bold; text-decoration:none; ">Edit Track Information</span>
                </a>
                <br />
                <br />
                <span style="font-size:x-small; font-weight:bold; ">Comments</span>
                <br />
                <hr color="#0080C0" size="3" />
                <xsl:for-each select="Track">
                  <xsl:call-template  name="Process">  
                      <xsl:with-param  name="text"  select="Notes"  />  
                  </xsl:call-template> 
                </xsl:for-each>
                <br />
                <br />
                <br />
                <span style="font-size:smaller; font-weight:bold; ">Lyrics</span>
                <br />
                <hr color="#0080C0" size="3" />
                <xsl:for-each select="Track">
		  <xsl:call-template  name="Process">  
                      <xsl:with-param  name="text"  select="Lyrics"  />  
                  </xsl:call-template> 
                </xsl:for-each>
                <br />
		<br />
                <span style="font-weight:bold; ">Custom Fields</span>
                <hr color="#0080C0" size="3" />Custom Field 1:<xsl:for-each select="Track">
                    <xsl:for-each select="CustomField1">
                        <xsl:apply-templates />
                    </xsl:for-each>
                </xsl:for-each>
                <br />Custom Field 2:<xsl:for-each select="Track">
                    <xsl:for-each select="CustomField2">
                        <xsl:apply-templates />
                    </xsl:for-each>
                </xsl:for-each>
                <br />Custom Field 3:<xsl:for-each select="Track">
                    <xsl:for-each select="CustomField3">
                        <xsl:apply-templates />
                    </xsl:for-each>
                </xsl:for-each>
                <br />Custom Field 4:<xsl:for-each select="Track">
                    <xsl:for-each select="CustomField4">
                        <xsl:apply-templates />
                    </xsl:for-each>
                </xsl:for-each>
                <br />Custom Field 5:<xsl:for-each select="Track">
                    <xsl:for-each select="CustomField5">
                        <xsl:apply-templates />
                    </xsl:for-each>
                </xsl:for-each>
                <br />
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>
