ThomasM: XSL Problem

Beitrag lesen

Hallo rap,

Da ich Anfänger bin, bräuchte ich Hilfe, damit es funktioniert. Kann das bitte jemand vervollständigen?

Das Hauptproblem ist wohl der Umgang mit dem Default-Namensraum, in welchem sich alle Elemente befinden. Probiere diesen Ansatz:

<?xml version="1.0" encoding="UTF-8"?>  
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"  
  xmlns:xspf="http://xspf.org/ns/0/" exclude-result-prefixes="xspf">  
  
  <xsl:template match="xspf:playlist">  
    <HTML>  
      <HEAD>  
        <TITLE>Test</TITLE>  
      </HEAD>  
      <BODY>  
        <xsl:apply-templates select="xspf:trackList"/>  
      </BODY>  
    </HTML>  
  </xsl:template>  
  
  <xsl:template match="xspf:trackList">  
    <TABLE border="1" style="table-layout:fixed" width="600">  
      <TR bgcolor="#FFFF00">  
        <TD>location</TD>  
        <TD>title</TD>  
      </TR>  
      <xsl:for-each select="xspf:track">  
        <TR>  
          <TD><xsl:value-of select="xspf:location"/></TD>  
          <TD><xsl:value-of select="xspf:title"/></TD>  
        </TR>  
      </xsl:for-each>  
    </TABLE>  
  </xsl:template>  
  
</xsl:stylesheet>

Grüße,
Thomas