home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2007 March / PCpro_2007_03.ISO / files / browser / msie7 / IE7Setup.exe / ieframe.dll.mui / HTML / FEEDDISPLAY.XSL < prev    next >
Encoding:
Extensible Markup Language  |  2006-10-27  |  19.4 KB  |  367 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:feedui="url:schemas-microsoft-com:feed-ui" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:cfi="http://www.microsoft.com/schemas/rss/core/2005/internal" version="1.0">
  3.  
  4.   <!-- Output method is XML even though we output the HTML fragment here. Don't add dependencies on the specifics of the HTML output method,
  5.   and the result has to be a valid XML. See bug 1715807 for more info. -->
  6.   <xsl:output method="xml" omit-xml-declaration="yes"/>
  7.     
  8.   <xsl:template match="/rss/channel">
  9.  
  10.     <!-- Feed name could be optional, so we use Untitled in that case -->
  11.     <xsl:variable name="feedTitle">
  12.       <xsl:choose>
  13.           <xsl:when test="title"><xsl:value-of select="title"/></xsl:when>
  14.           <xsl:otherwise>Unbenannt</xsl:otherwise>
  15.       </xsl:choose>
  16.     </xsl:variable>
  17.  
  18.     <!-- Sync engine turned off warning box -->
  19.     <div id="_syncwarnheader_" class="__feedview__syncengineheader" style="display: none;">
  20.         <div><b><span class="__feedview__loctxt">Die abonnierten Feeds werden nicht automatisch aktualisiert, da die entsprechende Einstellung ausgeschaltet ist.</span></b></div>
  21.         <div><img src="res://ieframe.dll/syncengine.png" border="0"/><span class="__feedview__loctxt"><a href="#" id="_turnonsynceng_">Automatische Aktualisierungen von Feeds einschalten</a></span></div>
  22.     </div>
  23.  
  24.    <!-- Just Subscribed Help Box -->
  25.    <div id="_justsubscribedhelpheader_" class="__feedview__justsubscribedhelpheader" style="display: none;">
  26.       
  27.           <div id="_miniexphelpnondocked_" style="display: none;">
  28.               <p><b><span class="__feedview__loctxt">Sie haben diesen Feed abonniert!</span></b></p>
  29.               <p><span class="__feedview__loctxt">Aktualisierte Inhalte k├╢nnen in Internet Explorer und anderen Programmen angezeigt werden, die die gemeinsame Feedliste verwenden.</span></p>
  30.               <p class="__feedview__justsubscribedbutton"><a href="#" id="_viewminiexpfeeds_"><img id="_viewminiexpfeeds_" src="res://ieframe.dll/favcenter.png" border="0"/><span id="_viewminiexpfeeds_" class="__feedview__loctxt">Eigene Feeds anzeigen</span></a></p>
  31.           </div>
  32.        
  33.           <div id="_miniexphelpdocked_" style="display: none;">
  34.               <p><b><span class="__feedview__loctxt">Sie haben diesen Feed abonniert!</span></b></p>
  35.           </div>
  36.  
  37.    </div>
  38.  
  39.     <!-- Subscribe header when feed is in preview mode -->
  40.     <div id="_subscribeheader_" class="__feedview__subscribeheader" style="display: none;">
  41.        
  42.         <xsl:choose>
  43.             <xsl:when test="link"><div class="__feedview__subscribeheadertitle"><a href="{link}" title="{link}"><xsl:value-of select="$feedTitle"/></a></div></xsl:when>
  44.             <xsl:otherwise><div class="__feedview__subscribeheadertitle"><xsl:value-of select="$feedTitle"/></div></xsl:otherwise>
  45.         </xsl:choose>
  46.  
  47.         <p><span class="__feedview__loctxt"><b>Der aktuelle Feed enth├ñlt Inhalte, die h├ñufig aktualisiert werden.</b> Wenn Sie einen Feed abonnieren, wird dieser zu der gemeinsamen Feedliste hinzugef├╝gt. Aktualisierte Inhalte des Feeds werden automatisch auf den Computer heruntergeladen und k├╢nnen in Internet Explorer und anderen Programmen angezeigt werden. <a href="#" id="_aboutfeedshelp_">Weitere Informationen ├╝ber Feeds</a></span></p>
  48.         <p class="__feedview__subscribeheaderbutton"><a id="_subscribe_" href="#"><img border="0" src="res://ieframe.dll/Subscribe_feed.gif" id="_subscribe_" alt="Plusschaltfl├ñche"/><span id="_subscribe_" class="__feedview__loctxt">Feed abonnieren</span></a></p>
  49.     
  50.     </div>
  51.  
  52.     <!-- Inline error messages -->
  53.     <xsl:choose>
  54.       <xsl:when test="@cfi:lastdownloaderror!='None'">
  55.           <div class="__feedview__inlineerror">
  56.               <img src="res://ieframe.dll/Icon_Error_Yellow.gif" alt="Warnungssymbol"/>
  57.               <span class="__feedview__loctxt">
  58.                 <xsl:choose>
  59.                     <xsl:when test="@cfi:lastdownloaderror='Failed'">Dieser Feed konnte nicht aktualisiert werden. Der Vorgang wird sp├ñter wiederholt.</xsl:when>
  60.                     <xsl:when test="@cfi:lastdownloaderror='Invalid Feed Format'">Das Format des Feeds wurde ge├ñndert, so dass der Feed nicht mehr von Internet Explorer aktualisiert werden kann.</xsl:when>
  61.                     <xsl:when test="@cfi:lastdownloaderror='Normalization Failed'">Dieser Feed enth├ñlt Fehler. Eine Aktualisierung des Feeds wird zu einem sp├ñteren Zeitpunkt erneut versucht.</xsl:when>
  62.                     <xsl:when test="@cfi:lastdownloaderror='Unsupported Auth'">Kennwortgesch├╝tzte Feeds k├╢nnen nicht aktualisiert werden.</xsl:when>
  63.                     <xsl:when test="@cfi:lastdownloaderror='Not Exist'">Dieser Feed ist nicht mehr vorhanden.</xsl:when>
  64.                     <xsl:when test="@cfi:lastdownloaderror='Unsupported DTD'">Feeds mit DTDs werden nicht unterst├╝tzt.</xsl:when>
  65.                     <xsl:when test="@cfi:lastdownloaderror='Size Limit Exceeded'">Dieser Feed kann nicht aktualisiert werden, da die Gr├╢├ƒe des Inhalts das Downloadlimit ├╝berschreitet.</xsl:when>
  66.                     <xsl:otherwise>Internet Explorer kann diesen Feed nicht aktualisieren.</xsl:otherwise>
  67.                 </xsl:choose>
  68.               </span>
  69.           </div>
  70.       </xsl:when>
  71.     </xsl:choose>
  72.  
  73.     <!-- Feed header -->
  74.     <div id="htmlNonSecureZone"><!-- Do not remove, see CFeedViewer::_IsElementInHTMLSecureZone -->
  75.  
  76.           <div id="_feedheader_" class="__feedview__feedHeader" style="display:none">
  77.  
  78.               <xsl:if test="image/url">
  79.  
  80.                   <a>
  81.                       <xsl:attribute name="href"><xsl:value-of select="image/link"/></xsl:attribute>
  82.                       <xsl:attribute name="width"><xsl:value-of select="image/width"/></xsl:attribute>
  83.  
  84.                       <img class="__feedview__feedHeaderImage">
  85.                           <xsl:attribute xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="src"><xsl:value-of select="image/url"/></xsl:attribute>
  86.                           <xsl:attribute xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="alt"><xsl:value-of select="image/title"/></xsl:attribute>
  87.                           <xsl:attribute xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="border">0</xsl:attribute>
  88.                           <xsl:attribute xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="alt">Feedbild</xsl:attribute>
  89.                       </img>
  90.                   </a>
  91.  
  92.               </xsl:if>
  93.  
  94.               <xsl:choose>
  95.             <xsl:when test="link">
  96.                 <div class="__feedview__feedTitle"><a href="{link}"><xsl:value-of select="$feedTitle"/></a></div>
  97.             </xsl:when>
  98.             <xsl:otherwise>
  99.                 <div class="__feedview__feedTitle"><xsl:value-of select="$feedTitle"/></div>
  100.             </xsl:otherwise>
  101.          </xsl:choose>
  102.           
  103.          <xsl:choose>
  104.               <xsl:when test="feedui:lastBuildDate"><div class="__feedview__feedPubDate"><xsl:value-of select="feedui:lastBuildDate"/></div></xsl:when>
  105.               <xsl:otherwise><xsl:if test="feedui:pubDate"><div class="__feedview__feedPubDate"><xsl:value-of select="feedui:pubDate"/></div></xsl:if></xsl:otherwise>
  106.          </xsl:choose>
  107.  
  108.       </div>
  109.  
  110.     </div>
  111.  
  112.     <div class="__feedview__feedContentDelimiter"></div>
  113.  
  114. </xsl:template>
  115.   
  116.   <xsl:template match="/rss/channel/item"> 
  117.  
  118.     <div>
  119.  
  120.         <xsl:if test="cfi:id">
  121.             <a><xsl:attribute name="name"><xsl:value-of select="cfi:id"/></xsl:attribute><xsl:text></xsl:text></a>
  122.         </xsl:if> 
  123.  
  124.         <xsl:if test="title">
  125.  
  126.             <xsl:choose>
  127.             <xsl:when test="link">
  128.             
  129.                 <xsl:choose>
  130.                     <xsl:when test="cfi:read = 'false'">
  131.                         <h2 class="__feedview__feedItemTitle"><a class="__feedview__feedItemUnreadTitleLink" href="{link}"><xsl:value-of select="title"/></a></h2>
  132.                     </xsl:when>
  133.                     <xsl:when test="cfi:read = 'true'">
  134.                         <h2 class="__feedview__feedItemTitle"><a class="__feedview__feedItemReadTitleLink" href="{link}"><xsl:value-of select="title"/></a></h2>
  135.                     </xsl:when>
  136.                     <xsl:otherwise>
  137.                         <h2 class="__feedview__feedItemTitle"><a class="__feedview__feedItemUnreadTitleLink" href="{link}"><xsl:value-of select="title"/></a></h2>
  138.                     </xsl:otherwise>
  139.                 </xsl:choose>
  140.                     
  141.              </xsl:when>
  142.              <xsl:otherwise>
  143.                     
  144.                 <xsl:choose>
  145.                     <xsl:when test="cfi:read = 'false'">
  146.                         <h2 class="__feedview__feedItemTitle"><span class="__feedview__feedItemUnreadTitleSpan"><xsl:value-of select="title"/></span></h2>
  147.                     </xsl:when>
  148.                     <xsl:when test="cfi:read = 'true'">
  149.                         <h2 class="__feedview__feedItemTitle"><span class="__feedview__feedItemReadTitleSpan"><xsl:value-of select="title"/></span></h2>
  150.                     </xsl:when>
  151.                     <xsl:otherwise>
  152.                         <h2 class="__feedview__feedItemTitle"><span class="__feedview__feedItemUnreadTitleSpan"><xsl:value-of select="title"/></span></h2>
  153.                     </xsl:otherwise>
  154.                 </xsl:choose> 
  155.                     
  156.              </xsl:otherwise>
  157.              </xsl:choose>
  158.             
  159.         </xsl:if>
  160.         
  161.         <xsl:choose>
  162.             <xsl:when test="cfi:read = 'false'">
  163.                 <div class="__feedview__feedItemTitleDelimiterUnread"></div>
  164.             </xsl:when>
  165.             <xsl:when test="cfi:read = 'true'">
  166.                 <div class="__feedview__feedItemTitleDelimiterRead"></div>
  167.             </xsl:when>
  168.             <xsl:otherwise>
  169.                 <div class="__feedview__feedItemTitleDelimiterUnread"></div>
  170.             </xsl:otherwise>
  171.         </xsl:choose>
  172.  
  173.         <div class="__feedview__feedItemPubDateAndAuthor">
  174.                     
  175.             <xsl:if test="feedui:pubDate">
  176.                 <span><xsl:value-of select="feedui:pubDate"/></span>
  177.             </xsl:if>        
  178.  
  179.             <xsl:if test="feedui:pubDate and author">
  180.                 <span> | </span>
  181.             </xsl:if>
  182.  
  183.             <xsl:if test="author">
  184.                 <span><xsl:value-of select="author"/></span>
  185.             </xsl:if>
  186.             
  187.             <xsl:if test="link">
  188.  
  189.                 <xsl:choose>
  190.  
  191.                     <xsl:when test="cfi:read = 'false'">
  192.                         <span class="__feedview__arrowunread"><a class="__feedview__feedItemUnreadTitleLink" href="{link}"><img src="res://ieframe.dll/feedarrowtrans.png" border="0" alt="Zum vollst├ñndigen Artikel wechseln"/></a></span>
  193.                     </xsl:when>
  194.                     <xsl:when test="cfi:read = 'true'">
  195.                         <span class="__feedview__arrowread"><a class="__feedview__feedItemReadTitleLink" href="{link}"><img src="res://ieframe.dll/feedarrowtrans.png" border="0" alt="Zum vollst├ñndigen Artikel wechseln"/></a></span>
  196.                     </xsl:when>
  197.                     <xsl:otherwise>
  198.                         <span class="__feedview__arrowunread"><a class="__feedview__feedItemUnreadTitleLink" href="{link}"><img src="res://ieframe.dll/feedarrowtrans.png" border="0" alt="Zum vollst├ñndigen Artikel wechseln"/></a></span>
  199.                     </xsl:otherwise>
  200.                 </xsl:choose>
  201.  
  202.             </xsl:if>
  203.  
  204.         </div>
  205.  
  206.         <div class="__feedview__feedItemBody">
  207.           <xsl:choose>
  208.             <xsl:when test="description[@type='xhtml']">
  209.               <xsl:copy-of select="description/*"/>
  210.             </xsl:when>
  211.             <xsl:otherwise>
  212.               <xsl:value-of disable-output-escaping="yes" select="description"/>
  213.             </xsl:otherwise>
  214.           </xsl:choose>
  215.         </div>
  216.  
  217.         <xsl:if test="comments">
  218.             
  219.           <div class="__feedview__feedItemComments">
  220.             <a href="{comments}"><img src="res://ieframe.dll/feedcomments.png" border="0" width="15" height="16" alt="Zu Kommentaren wechseln"/><span class="__feedview__loctxt">Kommentare <xsl:if test="slash:comments">(<xsl:value-of select="slash:comments"/>)</xsl:if></span></a>
  221.           </div>
  222.             
  223.         </xsl:if>
  224.         
  225.         <xsl:if test="enclosure">
  226.             
  227.             <xsl:for-each select="enclosure[position()=1]">
  228.  
  229.               <xsl:variable name="enclosureExt">
  230.                   <xsl:call-template name="extractFileExtension">
  231.                       <xsl:with-param name="url" select="normalize-space(@url)"/>
  232.                   </xsl:call-template>
  233.               </xsl:variable>
  234.                 
  235.               <div class="__feedview__feedItemEnclosure">
  236.                 <a>
  237.                   <xsl:attribute name="href">
  238.                     <xsl:choose>
  239.                         <xsl:when test="@cfi:downloadstatus">
  240.                             <xsl:choose>
  241.                                 <xsl:when test="@cfi:downloadstatus!='Downloaded'">
  242.                                     <xsl:value-of select="@url"/>
  243.                                 </xsl:when>
  244.                                 <xsl:otherwise>
  245.                                     <xsl:value-of select="@cfi:path"/>
  246.                                 </xsl:otherwise>
  247.                             </xsl:choose>
  248.                         </xsl:when>
  249.                         <xsl:otherwise>
  250.                             <xsl:value-of select="@url"/>
  251.                         </xsl:otherwise>
  252.                      </xsl:choose>
  253.                   </xsl:attribute>
  254.                   
  255.                   <img border="0" width="16" height="16" alt="Dateianlage ├╢ffnen">
  256.                     <xsl:attribute xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="src">
  257.                         <xsl:choose>
  258.                             <xsl:when test="@cfi:downloadstatus='Downloaded'">
  259.                                 <xsl:call-template name="iconForEnclosure">
  260.                                     <xsl:with-param name="ext" select="$enclosureExt"/>
  261.                                     <xsl:with-param name="isDownloaded">true</xsl:with-param>
  262.                                 </xsl:call-template>
  263.                             </xsl:when>
  264.                             <xsl:otherwise>
  265.                                 <xsl:call-template name="iconForEnclosure">
  266.                                     <xsl:with-param name="ext" select="$enclosureExt"/>
  267.                                     <xsl:with-param name="isDownloaded">false</xsl:with-param>
  268.                                 </xsl:call-template>
  269.                             </xsl:otherwise> 
  270.                         </xsl:choose>
  271.                     </xsl:attribute>
  272.                   </img>
  273.  
  274.                   <xsl:value-of select="../feedui:enclosureName"/>
  275.                     
  276.                 </a>
  277.  
  278.                 <xsl:if test="@cfi:downloadstatus">
  279.                     <span class="__feedview__feedItemEnclosureStatus"><span class="__feedview__loctxt">
  280.                         <xsl:choose>
  281.                             <xsl:when test="@cfi:downloadstatus='Downloaded'">(Heruntergeladen)</xsl:when>
  282.                             <xsl:when test="@cfi:downloadstatus='In Progress'">(Ausstehend)</xsl:when>
  283.                             <xsl:when test="@cfi:downloadstatus='Error'">
  284.                                 <xsl:choose>
  285.                                     <xsl:when test="@cfi:lastdownloaderror='Download Blocked'">(Downloadfehler - Geblockter Dateityp)</xsl:when>
  286.                                     <xsl:when test="@cfi:lastdownloaderror='Size Limit Exceeded'">(Downloadfehler - Die Dateigr├╢├ƒe ├╝berschreitet das Downloadlimit)</xsl:when>
  287.                                     <xsl:when test="@cfi:lastdownloaderror='Unsupported Auth'">(Downloadfehler - Kennwortgesch├╝tzt)</xsl:when>
  288.                                     <xsl:otherwise>(Downloadfehler)</xsl:otherwise>
  289.                                 </xsl:choose>
  290.                             </xsl:when>
  291.                         </xsl:choose>
  292.                     </span></span>
  293.                 </xsl:if>
  294.                   
  295.               </div>
  296.                 
  297.             </xsl:for-each>
  298.            
  299.         </xsl:if>
  300.         
  301.     </div>
  302.  
  303.     <div class="__feedview__feedItemDelimiter"></div>
  304.  
  305.   </xsl:template> <!-- feed item output -->
  306.  
  307.   <xsl:template name="iconForEnclosure">  <!-- return enclosure icon image file name -->
  308.       
  309.       <xsl:param name="ext"/>
  310.       <xsl:param name="isDownloaded"/>
  311.  
  312.       <xsl:variable name="iconFile">
  313.           <xsl:choose>
  314.               <xsl:when test="$ext='doc' or $ext='xls' or $ext='ppt'">
  315.                   <xsl:if test="$isDownloaded='false'">icon_enclosure_doc.png</xsl:if>
  316.                   <xsl:if test="$isDownloaded='true'">icon_enclosure_doc_done.png</xsl:if>
  317.               </xsl:when>
  318.               <xsl:when test="$ext='jpg' or $ext='gif' or $ext='png' or $ext='jpeg' or $ext='bmp'">
  319.                   <xsl:if test="$isDownloaded='false'">icon_enclosure_picture.png</xsl:if>
  320.                   <xsl:if test="$isDownloaded='true'">icon_enclosure_picture_done.png</xsl:if>
  321.               </xsl:when>
  322.               <xsl:when test="$ext='mp3' or $ext='wma'">
  323.                   <xsl:if test="$isDownloaded='false'">icon_enclosure_music.gif</xsl:if>
  324.                   <xsl:if test="$isDownloaded='true'">icon_enclosure_music_done.gif</xsl:if>
  325.               </xsl:when>
  326.               <xsl:when test="$ext='avi' or $ext='mov' or $ext='wmv' or $ext='mpg' or $ext='mpe' or $ext='mpeg'">
  327.                   <xsl:if test="$isDownloaded='false'">icon_enclosure_movie.png</xsl:if>
  328.                   <xsl:if test="$isDownloaded='true'">icon_enclosure_movie_done.png</xsl:if>
  329.               </xsl:when>
  330.               <xsl:when test="$ext='wpl'">
  331.                   <xsl:if test="$isDownloaded='false'">icon_enclosure_playlist.gif</xsl:if>
  332.                   <xsl:if test="$isDownloaded='true'">icon_enclosure_playlist_done.gif</xsl:if>
  333.               </xsl:when>
  334.               <xsl:otherwise>
  335.                   <xsl:if test="$isDownloaded='false'">icon_enclosure.png</xsl:if>
  336.                   <xsl:if test="$isDownloaded='true'">icon_enclosure_done.png</xsl:if>
  337.               </xsl:otherwise>
  338.           </xsl:choose>
  339.       </xsl:variable>
  340.       
  341.       <xsl:value-of select="concat('res://ieframe.dll/', $iconFile)"/>
  342.  
  343.   </xsl:template>
  344.  
  345.   <xsl:template name="extractFileExtension">
  346.  
  347.       <xsl:param name="url"/>
  348.       <xsl:variable name="nextToken" select="substring-before($url, '.')"/>
  349.       <xsl:variable name="rest" select="substring-after($url, '.')"/>
  350.  
  351.       <xsl:choose>
  352.           <xsl:when test="contains($rest, '.')">
  353.               <xsl:call-template name="extractFileExtension">
  354.                   <xsl:with-param name="url" select="$rest"/>
  355.               </xsl:call-template>
  356.           </xsl:when>
  357.           <xsl:otherwise>
  358.               <xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
  359.               <xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
  360.               <xsl:value-of select="translate($rest,$ucletters,$lcletters)"/> <!-- lowercase extension -->
  361.           </xsl:otherwise>
  362.       </xsl:choose>
  363.         
  364.   </xsl:template>
  365.  
  366. </xsl:stylesheet>
  367.