hh: xml-datei aus dem internet mit lokaler xsl-datei darstellen

Beitrag lesen

So könntest du es auch schrieben, vielleicht hilft das zum besseren Verständnis

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="html"/>
 <xsl:variable name="liste" select="document('http://ws.audioscrobbler.com/1.0/user/Fre86/recenttracks.xml')/recenttracks/*"/>
 <xsl:template match="/">
  <html>
   <head>
    <style type="text/css">@import url(last.fm.css);</style>
   </head>
   <body>
    <table cellspacing="0" cellpadding="0" border="0" width="100%">
      <xsl:for-each select="$liste">
      <tr>
      <td width="20" height="20">

<div id="linkeSpalte">
        <div style="position:absolute; top:0px; z-index:2;">
         <img src="pics/note.gif"/>
        </div>
        <div style="position:absolute; bottom:0px; z-index:1;">
         <img src="pics/links_unten.gif"/>
        </div>
        <div style="position:absolute; top:10px; bottom:10px; width:100%; background-color:#dbe0cf; z-index:-1;"></div>
       </div>
      </td>
      <td id="titel" style="vertical-align:top;width:15px;">
       <xsl:number level="single" count="track" format="1. "/>
      </td>
      <td id="titel">
       <xsl:value-of select="artist"/>- <xsl:value-of select="name"/></td>
      <td width="10">

<div id="rechteSpalte">
        <div style="position:absolute; top:0px;">
         <img src="pics/ende_oben.gif"/>
        </div>
        <div style="position:absolute; bottom:0px;">
         <img src="pics/ende_unten.gif"/>
        </div>
        <div style="position:absolute; top:8px; bottom:8px; width:100%; background-color:#dbe0cf;"></div>
       </div>
      </td>
     </tr>
     </xsl:for-each>
    </table>
   </body>
  </html>
 </xsl:template>
</xsl:stylesheet>