Subject: RE: [xsl] xsl:apply-templates behaving differently depending on the node copied? From: "Aron Bock" <aronbock@xxxxxxxxxxx> Date: Wed, 11 May 2005 12:02:46 +0000 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" />
<xsl:template match="node( ) | @*"> <xsl:copy> <xsl:apply-templates select="@* | node( )"/> </xsl:copy> </xsl:template>
<xsl:template match="td[count(text()) = 0]"> <td> <xsl:text>__NOTHING__</xsl:text> <xsl:apply-templates/> </td> </xsl:template>
From: knocte <knocte@xxxxxxxxx>
<page> <head> <title>Example</title> </head>
<content> <h1>Example</h1> <table> <tr> <td></td> <td>Something #1</td> </tr> <tr> <td>Somthing #2</td> <td /> </tr> </table> <content> </page>
And it will convert it to the following:
<html> <head> <title>Example</title> </head> <body> <div id="content"> <h1>Example</h1> <table> <tr> <td></td> <td>Something #1</td> </tr> <tr> <td>Something #2</td> <td /> </tr> </table> </div> <body> </html>
But how can I use apply-templates to obtain the following?:
<html> <head> <title>Example</title> </head> <body> <div id="content"> <h1>Example</h1> <table> <tr> <td>________NOTHING!_______</td> <td>Something #1</td> </tr> <tr> <td>Something #2</td> <td>________NOTHING!_______</td> </tr> </table> </div> <body> </html>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] xsl:apply-templates behaving , knocte | Thread | Re: [xsl] xsl:apply-templates behav, Mukul Gandhi |
Re: [xsl] xsl:apply-templates behav, Mukul Gandhi | Date | Re: [xsl] xsl:apply-templates behav, Mukul Gandhi |
Month |