<?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="MusicCD">
                    <xsl:for-each select="Title">
                        <span style="font-weight:bold; ">
                            <xsl:apply-templates />
                        </span>
                    </xsl:for-each>
                </xsl:for-each>&#160;<br />
                <hr color="#0080C0" size="3" />
                <table border="0" width="90%">
                    <tbody>
                        <tr>
                            <td width="52">
                                <span style="font-style:italic; font-weight:bold; font-size:smaller;">CDID</span>
                            </td>
                            <td width="127">
                                <xsl:for-each select="MusicCD">
                                    <xsl:for-each select="CDID">
                                        <xsl:apply-templates />
                                    </xsl:for-each>
                                </xsl:for-each>
                            </td>
                            <td width="49">
                                <span style="font-style:italic; font-weight:bold; font-size:smaller;">Artist</span>
                            </td>
                            <td width="307">
                                <xsl:for-each select="MusicCD">
                                    <xsl:for-each select="Artist">
                                        <xsl:apply-templates />
                                    </xsl:for-each>
                                </xsl:for-each>
                            </td>
                        </tr>
                        <tr>
                            <td width="52">
                                <span style="font-style:italic; font-weight:bold; font-size:smaller;">Catalog</span>
                            </td>
                            <td width="127">
                                <xsl:for-each select="MusicCD">
                                    <xsl:for-each select="Catalog">
                                        <xsl:apply-templates />
                                    </xsl:for-each>
                                </xsl:for-each>
                            </td>
                            <td width="49">
                                <span style="font-style:italic; font-weight:bold; font-size:smaller;">Genre</span>
                            </td>
                            <td width="307">
                                <xsl:for-each select="MusicCD">
                                    <xsl:for-each select="Genre">
                                        <xsl:apply-templates />
                                    </xsl:for-each>
                                </xsl:for-each>
                            </td>
                        </tr>
                        <tr>
                            <td width="52">
                                <span style="font-style:italic; font-weight:bold;font-size:smaller; ">Label</span>
                            </td>
                            <td width="127">
                                <xsl:for-each select="MusicCD">
                                    <xsl:for-each select="Label">
                                        <xsl:apply-templates />
                                    </xsl:for-each>
                                </xsl:for-each>
                            </td>
                            <td width="49">
                                <span style="font-style:italic; font-weight:bold; font-size:smaller;">Year</span>
                            </td>
                            <td width="307">
                                <xsl:for-each select="MusicCD">
                                    <xsl:for-each select="Year">
                                        <xsl:apply-templates />
                                    </xsl:for-each>
                                </xsl:for-each>
                            </td>
                        </tr>
                        <tr>
                            <td width="52">
                                <span style="font-style:italic; font-weight:bold; font-size:smaller;">Format</span>
                            </td>
                            <td width="127">
                                <xsl:for-each select="MusicCD">
                                    <xsl:for-each select="Format">
                                        <xsl:apply-templates />
                                    </xsl:for-each>
                                </xsl:for-each>
                            </td>
                            <td width="49">
                                <span style="font-style:italic; font-weight:bold;font-size:smaller; ">Audio</span>
                            </td>
                            <td width="307">
                                <xsl:for-each select="MusicCD">
                                    <xsl:for-each select="Audio">
                                        <xsl:apply-templates />
                                    </xsl:for-each>
                                </xsl:for-each>
                            </td>
                        </tr>
                    </tbody>
                </table>
		<xsl:for-each select="MusicCD">
                  <xsl:for-each select="Tag">
		    <span style="color:#008040; font-size:smaller; ">
                       <xsl:apply-templates />&#160;
		    </span>
                  </xsl:for-each>
                </xsl:for-each>
		<br />
                <a>
                    <xsl:attribute name="href"><xsl:text disable-output-escaping="yes">http://cdlibx/action/EditAlbum.xml#</xsl:text><xsl:value-of select="MusicCD/CDID" /></xsl:attribute>
                    <span style="color:#C0C0C0; font-family:Courier New; font-size:smaller; font-weight:bold; text-decoration:none; ">Edit Album Information</span>
                </a>
                <br />
                <br />
                <span style="color:#000000; font-weight:bold; ">Tracks</span>
                <br />
                <xsl:for-each select="MusicCD">
                    <table border="0" border-collapse="separate" rules="all" width="90%">
                        <thead>
                            <tr bgcolor="#0080C0">
                                <td align="center" width="20">
                                    <span style="color:white; font-style:italic; font-weight:bold; ">#</span>
                                </td>
                                <td align="center" >
                                    <span style="color:white; font-style:italic; font-weight:bold; font-size:smaller;">Title</span>
                                </td>
                                <td align="center">
                                    <span style="color:white; font-style:italic; font-weight:bold;font-size:smaller; ">Artist</span>
                                </td>
                                <td align="center" width="40">
                                    <span style="color:white; font-style:italic; font-weight:bold; font-size:smaller;">Length</span>
                                </td>
                            </tr>
                        </thead>
                        <tbody>
                            <xsl:for-each select="Track">
                                <tr bgcolor="#EEEEEE">
                                    <td align="center" width="20">
                                        <xsl:for-each select="Index">
                                            <xsl:apply-templates />
                                        </xsl:for-each>
                                    </td>
                                    <td width="287">
                                        <xsl:for-each select="Title">
                                            <a>
                                                <xsl:attribute name="href"><xsl:text disable-output-escaping="yes">http://cdlibx/TRACK/</xsl:text><xsl:value-of select="../TrackID" /><xsl:text disable-output-escaping="yes">.xml</xsl:text></xsl:attribute>
                                                <span style="font-family:Times New Roman; ">
                                                    <xsl:apply-templates />
                                                </span>
                                            </a>
                                        </xsl:for-each>
                                    </td>
                                    <td>
                                        <xsl:for-each select="Artist">
                                            <xsl:apply-templates />
                                        </xsl:for-each>
                                    </td>
                                    <td>
                                        <xsl:for-each select="Length">
                                            <xsl:apply-templates />
                                        </xsl:for-each>
                                    </td>
                                </tr>
                            </xsl:for-each>
                        </tbody>
                    </table>
                </xsl:for-each>
                <br />
                <span style="font-weight:bold; ">Pictures</span>&#160;&#160;
                                <a>
                    <xsl:attribute name="href"><xsl:text disable-output-escaping="yes">http://cdlibx/action/AddPic.xml#</xsl:text><xsl:value-of select="MusicCD/CDID" /></xsl:attribute>
                    <span style="color:#C0C0C0; font-family:Courier New; font-size:smaller; font-weight:bold; text-decoration:none; ">Add Picture</span>
                </a>
                <br />
                <hr color="#0080C0" size="3" />
                <xsl:for-each select="MusicCD">
                    <xsl:for-each select="Pictures">
		    <a>
                         <xsl:attribute name="href"><xsl:text disable-output-escaping="yes">http://cdlibx/IMAGE/</xsl:text><xsl:value-of select="." /><xsl:text disable-output-escaping="yes">.xml</xsl:text></xsl:attribute>
			<img style="border-color:#C0C0C0; border-style:dashed; border-width:thin; margin:10; " border="0">
                            <xsl:attribute name="src"><xsl:text disable-output-escaping="yes">http://cdlibx/THUMB/</xsl:text><xsl:value-of select="." /><xsl:text disable-output-escaping="yes">.xml</xsl:text></xsl:attribute>
                        </img>
		   </a>
		        <a>
                            <xsl:attribute name="href"><xsl:text disable-output-escaping="yes">http://cdlibx/action/DelPic.xml#</xsl:text><xsl:value-of select="." /></xsl:attribute>
                            <span style="color:#C0C0C0; font-size:smaller; font-weight:bold; text-decoration:none; ">Delete</span> 
                        </a>&#160;
		       <a>
                    <xsl:attribute name="href"><xsl:text disable-output-escaping="yes">http://cdlibx/action/ExportPic.xml#</xsl:text><xsl:value-of select="." /></xsl:attribute>
                    <span style="color:#C0C0C0;font-size:smaller; font-weight:bold; text-decoration:none; ">Export</span>
                       </a>
                    </xsl:for-each>
                </xsl:for-each>
                <br />

                <br />
                <span style="font-weight:bold; ">Comments</span>
                <br />
                <hr color="#0080C0" size="3" />
                  <xsl:for-each select="MusicCD">
		  <xsl:call-template  name="Process">  
                      <xsl:with-param  name="text"  select="Notes"  />  
                  </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="MusicCD">
                    <xsl:for-each select="CustomField1">
                        <xsl:apply-templates />
                    </xsl:for-each>
                </xsl:for-each>
                <br />Custom Field 2:<xsl:for-each select="MusicCD">
                    <xsl:for-each select="CustomField2">
                        <xsl:apply-templates />
                    </xsl:for-each>
                </xsl:for-each>
                <br />Custom Field 3:<xsl:for-each select="MusicCD">
                    <xsl:for-each select="CustomField3">
                        <xsl:apply-templates />
                    </xsl:for-each>
                </xsl:for-each>
                <br />Custom Field 4:<xsl:for-each select="MusicCD">
                    <xsl:for-each select="CustomField4">
                        <xsl:apply-templates />
                    </xsl:for-each>
                </xsl:for-each>
                <br />Custom Field 5:<xsl:for-each select="MusicCD">
                    <xsl:for-each select="CustomField5">
                        <xsl:apply-templates />
                    </xsl:for-each>
                </xsl:for-each>
                <br />

            </body>
        </html>
    </xsl:template>
    <xsl:template match="Artist">
        <xsl:apply-templates />
    </xsl:template>
    <xsl:template match="Audio">
        <xsl:apply-templates />
    </xsl:template>
    <xsl:template match="CDID">
        <xsl:apply-templates />
    </xsl:template>
</xsl:stylesheet>
