home *** CD-ROM | disk | FTP | other *** search
/ Sony α Series DSLR Camera Picture Utilities / SONYPICTUTIL.ISO / DIApp / DataDiscMaker / data1.cab / app-common / DiscData / DataDiscImage.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2007-06-21  |  6.0 KB  |  145 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.         <xsl:variable name="CreateLink">
  6.             <xsl:apply-templates select="key[text()='CreateLink']" />
  7.         </xsl:variable>
  8.         <xsl:variable name="FilePath">
  9.             <xsl:apply-templates select="key[text()='FilePath']" />
  10.         </xsl:variable>
  11.         <xsl:variable name="ThumbnailPath">
  12.             <xsl:apply-templates select="key[text()='ThumbnailPath']" />
  13.         </xsl:variable>
  14.         <xsl:variable name="ImagePath">
  15.             <xsl:choose>
  16.                 <xsl:when test="$ThumbnailPath != ''">
  17.                     <xsl:value-of select="$ThumbnailPath" />
  18.                 </xsl:when><xsl:otherwise>
  19.                     <xsl:value-of select="$FilePath" />
  20.                 </xsl:otherwise>
  21.             </xsl:choose>
  22.         </xsl:variable>
  23.         <xsl:variable name="MovieMessage">
  24.             <xsl:apply-templates select="key[text()='MovieMessage']" />
  25.         </xsl:variable>
  26.         <xsl:variable name="MovieWarning">
  27.             <xsl:apply-templates select="key[text()='MovieWarning']" />
  28.         </xsl:variable>
  29.  
  30.         <!-- Root HTML -->
  31.         <html>
  32.         <head>
  33.             <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /-->
  34.             <meta http-equiv="Content-Style-Type" content="text/css" />
  35.             <title><xsl:apply-templates select="key[text()='Title']" /></title>
  36.             <link rel="stylesheet" type="text/css" href="../parts/datadisc.css" media="all" />
  37.         </head>
  38.         <body>
  39.             <div class="center">
  40.                 <table class="layout" summary="layout">
  41.                     <tr><td class="header">
  42.                         <img class="baricon" src="../parts/imgicon.png" width="32" height="30" />
  43.                         <div class="header"><xsl:apply-templates select="key[text()='Title']" /></div>
  44.                         <div class="headerdate">
  45.                             <xsl:apply-templates select="key[text()='Date']" />
  46.                             <xsl:text> </xsl:text>
  47.                             <xsl:apply-templates select="key[text()='Time']" />
  48.                         </div>
  49.                     </td></tr>
  50.                     <tr><td class="layout">
  51.                         <xsl:call-template name="PageIndex" />
  52.                         <xsl:call-template name="Navigator" />
  53.                     </td></tr>
  54.                     <tr><td class="slide">
  55.                         <xsl:if test="$MovieMessage != ''">
  56.                             <div class="slidemsg"><xsl:value-of select="$MovieMessage" /></div>
  57.                         </xsl:if>
  58.                         <xsl:if test="$MovieWarning != ''">
  59.                             <div class="slidewarning"><xsl:value-of select="$MovieWarning" /></div>
  60.                         </xsl:if>
  61.                         <xsl:choose>
  62.                             <xsl:when test="$CreateLink != ''">
  63.                                 <xsl:element name="a"><xsl:attribute name="href"><xsl:value-of select="$FilePath" /></xsl:attribute>
  64.                                     <xsl:element name="img">
  65.                                         <xsl:attribute name="class">thumbnail</xsl:attribute>
  66.                                         <xsl:attribute name="src"><xsl:value-of select="$ImagePath" /></xsl:attribute>
  67.                                         <xsl:attribute name="alt"><xsl:value-of select="$FilePath" /></xsl:attribute>
  68.                                         <xsl:attribute name="height"><xsl:apply-templates select="key[text()='SlideHeight']" /></xsl:attribute>
  69.                                         <xsl:attribute name="width"><xsl:apply-templates select="key[text()='SlideWidth']" /></xsl:attribute>
  70.                                     </xsl:element>
  71.                                 </xsl:element>
  72.                             </xsl:when><xsl:otherwise>
  73.                                 <xsl:element name="img">
  74.                                     <xsl:attribute name="class">thumbnail</xsl:attribute>
  75.                                     <xsl:attribute name="src"><xsl:value-of select="$ImagePath" /></xsl:attribute>
  76.                                     <xsl:attribute name="alt"><xsl:value-of select="$FilePath" /></xsl:attribute>
  77.                                     <xsl:attribute name="height"><xsl:apply-templates select="key[text()='SlideHeight']" /></xsl:attribute>
  78.                                     <xsl:attribute name="width"><xsl:apply-templates select="key[text()='SlideWidth']" /></xsl:attribute>
  79.                                 </xsl:element>
  80.                             </xsl:otherwise>
  81.                         </xsl:choose>
  82.                     </td></tr>
  83.                 </table>
  84.             </div>
  85.         </body>
  86.         </html>
  87.     </xsl:template>
  88.  
  89.     <xsl:template name="Navigator">
  90.         <xsl:variable name="IndexPage">
  91.             <xsl:apply-templates select="key[text()='IndexPage']" />
  92.         </xsl:variable>
  93.         <xsl:variable name="PreviousPage">
  94.             <xsl:apply-templates select="key[text()='PreviousPage']" />
  95.         </xsl:variable>
  96.         <xsl:variable name="NextPage">
  97.             <xsl:apply-templates select="key[text()='NextPage']" />
  98.         </xsl:variable>
  99.  
  100.         <!-- Navigator HTML -->
  101.         <div class="navigator">
  102.             <xsl:choose>
  103.                 <xsl:when test="$IndexPage != ''">
  104.                     <xsl:element name="a">
  105.                         <xsl:attribute name="href"><xsl:value-of select="$IndexPage"/></xsl:attribute>
  106.                         <img class="icon" src="../parts/back.png" width="28" height="16" />
  107.                     </xsl:element>
  108.                 </xsl:when><xsl:otherwise><img class="margin" src="../parts/space.png" width="28" height="16" /></xsl:otherwise>
  109.             </xsl:choose>
  110.             <img class="margin" src="../parts/space.png" width="16" height="16" />
  111.             <xsl:choose>
  112.                 <xsl:when test="$PreviousPage != ''">
  113.                     <xsl:element name="a">
  114.                         <xsl:attribute name="href"><xsl:value-of select="$PreviousPage"/></xsl:attribute>
  115.                         <img class="icon" src="../parts/prev.png" width="16" height="16" />
  116.                     </xsl:element>
  117.                 </xsl:when><xsl:otherwise><img class="margin" src="../parts/space.png" width="16" height="16" /></xsl:otherwise>
  118.             </xsl:choose>
  119.             <img class="margin" src="../parts/space.png" width="16" height="16" />
  120.             <xsl:choose>
  121.                 <xsl:when test="$NextPage != ''">
  122.                     <xsl:element name="a">
  123.                         <xsl:attribute name="href"><xsl:value-of select="$NextPage"/></xsl:attribute>
  124.                         <img class="icon" src="../parts/next.png" width="16" height="16" />
  125.                     </xsl:element>
  126.                 </xsl:when><xsl:otherwise><img class="margin" src="../parts/space.png" width="16" height="16" /></xsl:otherwise>
  127.             </xsl:choose>
  128.         </div>
  129.     </xsl:template>
  130.  
  131.     <xsl:template name="PageIndex">
  132.         <!-- PageIndex HTML -->
  133.         <div class="pageindex">
  134.             <xsl:apply-templates select="key[text()='ImageIndex']" />
  135.             <xsl:text> / </xsl:text>
  136.             <xsl:apply-templates select="key[text()='TotalImages']" />
  137.         </div>
  138.     </xsl:template>
  139.  
  140.  
  141.     <xsl:template match="key">
  142.         <xsl:value-of select="following-sibling::node()[1]" />
  143.     </xsl:template>
  144. </xsl:stylesheet>
  145.