[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Deleting textnode
Hi Animesh, > I want to delete a text node. > > Suppose the XML format is something like: > <tr> > Google search: > <a>English</a> > <a>English</a> > <a>English</a> > </td> > > and I want to delete "Gogole Search" text node. Start off with an identity transformation: <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="@*|node()" /> </xsl:copy> </xsl:template> Then add a template that does nothing with text node children of <td> elements: <xsl:template match="td/text()" /> Alternatively, add a template that only applies templates to the element children of the <td> element, rather than to all its child nodes: <xsl:template match="td"> <xsl:copy> <xsl:apply-templates select="@*|*" /> </xsl:copy> </xsl:template> Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|