Thomas Meinike: XML + XSLT mixed content

Beitrag lesen

Hallo,

Nun würde ich über XSLT die XML Datei zu HTML umwandeln. Dabei habe ich immer das Problem das entweder Texte doppelt vorkommen. Oder wenn ich text() mache nur 'dies ist' erhalte. Kann mir jemand helfen wie ich das in den Griff bekomme?

Der naheliegendste Ansatz ist:

  
<?xml version="1.0" encoding="ISO-8859-1"?>  
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">  
  
<xsl:template match="wurzel">  
  
<html>  
  <head>  
    <title>...</title>  
  </head>  
  <body>  
    <xsl:apply-templates select="inhalt"/>  
  </body>  
</html>  
  
</xsl:template>  
  
<xsl:template match="kursiv">  
  <i><xsl:value-of select="."/></i>  
</xsl:template>  
  
<xsl:template match="fett">  
  <b><xsl:value-of select="."/></b>  
</xsl:template>  
  
</xsl:stylesheet>

MfG, Thomas