home *** CD-ROM | disk | FTP | other *** search
/ Sony α Series DSLR Camera Picture Utilities / SONYPICTUTIL.ISO / DIApp / DataDiscMaker / data1.cab / app-common / DiscData / DataDiscIndex.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2007-06-21  |  8.4 KB  |  221 lines

  1. ∩╗┐<?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  3.     <xsl:output method="html"  version="1.0" indent="yes" encoding="UTF-8" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
  4.     <xsl:template match="/plist/dict">
  5.         <!-- Root HTML -->
  6.         <html>
  7.         <head>
  8.             <!--<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />-->
  9.             <meta http-equiv="Content-Style-Type" content="text/css" />
  10.             <title><xsl:apply-templates select="key[text()='Title']" /></title>
  11.             <link rel="stylesheet" type="text/css" href="parts/datadisc.css" media="all" />
  12.         </head>
  13.         <body>
  14.             <div class="center">
  15.                 <table class="layout" summary="layout">
  16.                     <tr><td class="header">
  17.                         <img class="baricon" src="parts/discicon.png" width="32" height="30" />
  18.                         <div class="header"><xsl:apply-templates select="key[text()='Title']" /></div>
  19.                         <div class="headerlink">
  20.                             <xsl:element name="a">
  21.                                 <xsl:attribute name="target">_blank</xsl:attribute>
  22.                                 <xsl:attribute name="href"><xsl:apply-templates select="key[text()='PicturesFolderPath']" /></xsl:attribute>
  23.                                 <img class="icon" src="parts/folder.png" width="16" height="16" />
  24.                                 <img class="margin" src="parts/space.png" width="4" height="16" />
  25.                                 <xsl:apply-templates select="key[text()='PicturesFolderText']" />
  26.                             </xsl:element>
  27.                         </div>
  28.                     </td></tr>
  29.                     <tr><td class="layout">
  30.                         <xsl:if test="key[text()='PageLinks'] != ''">
  31.                             <xsl:apply-templates select="key[text()='PageLinks']/following-sibling::node()[1]" mode="PageLinks" />
  32.                         </xsl:if>
  33.                         <xsl:call-template name="Navigator" />
  34.                     </td></tr>
  35.                     <tr><td class="thumbnails">
  36.                         <xsl:apply-templates select="key[text()='Thumbnails']/following-sibling::node()[1]" mode="Thumbnails" />
  37.                     </td></tr>
  38.                     <tr><td class="layout">
  39.                         <xsl:if test="key[text()='PageLinks'] != ''">
  40.                             <xsl:apply-templates select="key[text()='PageLinks']/following-sibling::node()[1]" mode="PageLinks" />
  41.                         </xsl:if>
  42.                         <xsl:call-template name="Navigator" />
  43.                     </td></tr>
  44.                     <tr><td class="footer">
  45.                         <img class="baricon" src="parts/pmbicon.png" width="32" height="30" />
  46.                         <div class="footer">Picture Motion Browser</div>
  47.                     </td></tr>
  48.                 </table>
  49.             </div>
  50.         </body>
  51.         </html>
  52.     </xsl:template>
  53.  
  54.     <xsl:template name="Navigator">
  55.         <xsl:variable name="PreviousPage">
  56.             <xsl:apply-templates select="key[text()='PreviousPage']" />
  57.         </xsl:variable>
  58.         <xsl:variable name="NextPage">
  59.             <xsl:apply-templates select="key[text()='NextPage']" />
  60.         </xsl:variable>
  61.  
  62.         <!-- Navigator HTML -->
  63.         <div class="navigator">
  64.             <xsl:choose>
  65.                 <xsl:when test="$PreviousPage != ''">
  66.                     <xsl:element name="a">
  67.                         <xsl:attribute name="href"><xsl:value-of select="$PreviousPage"/></xsl:attribute>
  68.                         <img class="icon" src="parts/prev.png" width="16" height="16" />
  69.                     </xsl:element>
  70.                 </xsl:when><xsl:otherwise><img class="margin" src="parts/space.png" width="16" height="16" /></xsl:otherwise>
  71.             </xsl:choose>
  72.             <img class="margin" src="parts/space.png" width="16" height="16" />
  73.             <xsl:choose>
  74.                 <xsl:when test="$NextPage != ''">
  75.                     <xsl:element name="a">
  76.                         <xsl:attribute name="href"><xsl:value-of select="$NextPage"/></xsl:attribute>
  77.                         <img class="icon" src="parts/next.png" width="16" height="16" />
  78.                     </xsl:element>
  79.                 </xsl:when><xsl:otherwise><img class="margin" src="parts/space.png" width="16" height="16" /></xsl:otherwise>
  80.             </xsl:choose>
  81.         </div>
  82.     </xsl:template>
  83.  
  84.     <xsl:template match="dict" mode="pagelink">
  85.         <!-- PageLink HTML -->
  86.         <xsl:variable name="Type">
  87.             <xsl:apply-templates select="key[text()='Type']" />
  88.         </xsl:variable>
  89.         <xsl:choose>
  90.             <xsl:when test="$Type = 'OmitSeparator'">
  91.                 <xsl:text> ... </xsl:text>
  92.             </xsl:when><xsl:when test="$Type = 'Separator'">
  93.                 <xsl:text> | </xsl:text>
  94.             </xsl:when><xsl:otherwise>
  95.                 <xsl:variable name="Page">
  96.                     <xsl:apply-templates select="key[text()='Page']" />
  97.                 </xsl:variable>
  98.                 <xsl:choose>
  99.                     <xsl:when test="$Page != ''">
  100.                         <xsl:element name="a">
  101.                             <xsl:attribute name="href"><xsl:value-of select="$Page"/></xsl:attribute>
  102.                             <xsl:apply-templates select="key[text()='Label']" />
  103.                         </xsl:element>
  104.                     </xsl:when><xsl:otherwise>
  105.                         <span class="currentpage"><xsl:apply-templates select="key[text()='Label']" /></span>
  106.                     </xsl:otherwise>
  107.                 </xsl:choose>
  108.             </xsl:otherwise>
  109.         </xsl:choose>
  110.     </xsl:template>
  111.  
  112.     <xsl:template match="dict" mode="thumbnail">
  113.         <!-- Thumbnail cell HTML -->
  114.         <td class="thumbnail">
  115.             <div class="thumbnail">
  116.                 <xsl:element name="a">
  117.                     <xsl:attribute name="href"><xsl:apply-templates select="key[text()='Path']" /></xsl:attribute>
  118.                     <xsl:attribute name="class">thumbnail</xsl:attribute>
  119.                     <xsl:element name="img">
  120.                         <xsl:attribute name="class">thumbnail</xsl:attribute>
  121.                         <xsl:attribute name="src"><xsl:apply-templates select="key[text()='Thumbnail']" /></xsl:attribute>
  122.                         <xsl:attribute name="height"><xsl:apply-templates select="key[text()='ThumbnailHeight']" /></xsl:attribute>
  123.                         <xsl:attribute name="width"><xsl:apply-templates select="key[text()='ThumbnailWidth']" /></xsl:attribute>
  124.                         <xsl:attribute name="alt">
  125.                             <xsl:apply-templates select="key[text()='Description']" />
  126.                             <xsl:text> </xsl:text>
  127.                             <xsl:apply-templates select="key[text()='Date']" />
  128.                             <xsl:text> </xsl:text>
  129.                             <xsl:apply-templates select="key[text()='Time']" />
  130.                         </xsl:attribute>
  131.                     </xsl:element>
  132.                     <span class="information">
  133.                         <xsl:apply-templates select="key[text()='Description']" /><br/>
  134.                         <xsl:apply-templates select="key[text()='Date']" />
  135.                         <xsl:text> </xsl:text>
  136.                         <xsl:apply-templates select="key[text()='Time']" />
  137.                     </span>
  138.                 </xsl:element>
  139.             </div>
  140.         </td>
  141.     </xsl:template>
  142.  
  143.     <xsl:template name="OutputEmptyCol">
  144.         <!-- Empty cell HTML -->
  145.         <td class="empty">
  146.         </td>
  147.     </xsl:template>
  148.  
  149.     <xsl:template match="*" mode="PageLinks">
  150.         <div class="pagelinks">
  151.             <xsl:call-template name="PageLinksLoop">
  152.                 <xsl:with-param name="index" select="0" />
  153.                 <xsl:with-param name="count" select="count(dict)" />
  154.             </xsl:call-template>
  155.         </div>
  156.     </xsl:template>
  157.  
  158.     <xsl:template name="PageLinksLoop">
  159.         <xsl:param name="index" />
  160.         <xsl:param name="count" />
  161.         <xsl:if test="$index < $count">
  162.             <xsl:apply-templates select="dict[$index+1]" mode="pagelink" />
  163.             <xsl:call-template name="PageLinksLoop">
  164.                 <xsl:with-param name="index" select="$index+1" />
  165.                 <xsl:with-param name="count" select="$count" />
  166.             </xsl:call-template>
  167.         </xsl:if>
  168.     </xsl:template>
  169.  
  170.     <xsl:template match="*" mode="Thumbnails">
  171.         <table class="thumbnails" summary="thumbnails">
  172.             <xsl:call-template name="ThumbnailRowLoop">
  173.                 <xsl:with-param name="startIndex" select="0" />
  174.                 <xsl:with-param name="count" select="count(dict)" />
  175.             </xsl:call-template>
  176.         </table>
  177.     </xsl:template>
  178.  
  179.     <xsl:template name="ThumbnailRowLoop">
  180.         <xsl:param name="startIndex" />
  181.         <xsl:param name="count" />
  182.         <xsl:if test="$startIndex < $count">
  183.             <tr>
  184.                 <xsl:call-template name="ThumbnailColLoop">
  185.                     <xsl:with-param name="index" select="$startIndex" />
  186.                     <xsl:with-param name="finishIndex" select="$startIndex+5" />
  187.                     <xsl:with-param name="count" select="$count" />
  188.                 </xsl:call-template>
  189.             </tr>
  190.             <xsl:call-template name="ThumbnailRowLoop">
  191.                 <xsl:with-param name="startIndex" select="$startIndex+5" />
  192.                 <xsl:with-param name="count" select="$count" />
  193.             </xsl:call-template>
  194.         </xsl:if>
  195.     </xsl:template>
  196.  
  197.     <xsl:template name="ThumbnailColLoop">
  198.         <xsl:param name="index" />
  199.         <xsl:param name="finishIndex" />
  200.         <xsl:param name="count" />
  201.         <xsl:if test="$index < $finishIndex">
  202.             <xsl:choose>
  203.                 <xsl:when test="$index < $count">
  204.                     <xsl:apply-templates select="dict[$index+1]" mode="thumbnail" />
  205.                 </xsl:when><xsl:otherwise>
  206.                     <xsl:call-template name="OutputEmptyCol" />
  207.                 </xsl:otherwise>
  208.             </xsl:choose>
  209.             <xsl:call-template name="ThumbnailColLoop">
  210.                 <xsl:with-param name="index" select="$index+1" />
  211.                 <xsl:with-param name="finishIndex" select="$finishIndex" />
  212.                 <xsl:with-param name="count" select="$count" />
  213.             </xsl:call-template>
  214.         </xsl:if>
  215.     </xsl:template>
  216.  
  217.     <xsl:template match="key">
  218.         <xsl:value-of select="following-sibling::node()[1]" />
  219.     </xsl:template>
  220. </xsl:stylesheet>
  221.