dey: HTML in XSL, Verschachtelte Templates

Beitrag lesen

Hallo,

Ich würde es wie folgt versuchen, siehe unten

<?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:template match="//docs">
  <div style="border:1px solid red">
   <xsl:apply-templates select="row"/>
  </div>
</xsl:template>

<xsl:template match="docs/row[position() = 1]">
  <table border="1">
    <tr><td colspan="2"><b><xsl:value-of select="@title"/></b></td></tr>
    <tr>
    <td valign="top"><img src="{@imgsrc}"/></td>
    <td>
     <xsl:value-of select="@teaser"/><br/><br/>
     <xsl:apply-templates select="row"/> <!-- ??????  -->

<xsl:call-templates select="row2-x"/>

</td>
   </tr>
  </table>
</xsl:template>

<xsl:template match="docs/row[position() > 1]">

<xsl:template name="row2-x">
     <xsl:for-each select="docs/row[position() > 1]">
     ..........

<xsl:value-of select="@title"/><br/>
</xsl:template>

</xsl:stylesheet>

bydey

--
-- noch immer ein erfolgloser <DIV> Jünger --