Toon posts:

[XSL] Start tag does not match end tag

Pagina: 1
Acties:

Verwijderd

Topicstarter
XSL:
code:
1
2
3
4
5
6
7
8
9
10
11
<table>
    <tr>
        <xsl:for-each select="imagelinklist/imagelink">
            <xsl:call-template name="imagelink"/>
            <xsl:if test="position() mod 3 = 0">
                </tr>
                <tr>
            </xsl:if>
        </xsl:for-each>
    </tr>
</table>


foutmelding : End tag 'tr' does not match the start tag 'p'. Error processing resource

Ik weet waar de fout zit, maar ik heb die code constructie nodig, om de tabel goed te krijgen. Nou wou ik vragen of er een work around is.

Alvast bedankt

Verwijderd

Topicstarter
Heb de oplossing.

XSL:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<xsl:template match="imagelink" mode="row"> 
    <xsl:if test="position() mod 3 = 1" >
        <tr>
            <xsl:apply-templates select="." mode="real" />
            <xsl:apply-templates select="following-sibling::imagelink[position()=1]" mode="real" />
            <xsl:apply-templates select="following-sibling::imagelink[position()=2]" mode="real" />     
        </tr>           
    </xsl:if>   
</xsl:template>

<xsl:template match="imagelink" mode="real">    
    <td>
        <div style="border-width:0px;"><a href="{@link}">[img]"{@imageurl}"[/img]</a></div> 
    </td>
</xsl:template>


aanroepen met

code:
1
<xsl:apply-templates select="imagelink" mode="row" />