[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Deleting textnode

Subject: Re: Deleting textnode
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 23 Apr 2004 10:36:18 +0100
remove 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/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.