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

RE: Changing Attribute Value in all the ChildNodes at

Subject: RE: Changing Attribute Value in all the ChildNodes at any level down the current node.
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Thu, 27 May 2004 18:09:34 +0200
RE:  Changing Attribute Value in all the ChildNodes at
> -----Original Message-----
> From: Animesh Sharma [mailto:asharma@xxxxxxxxxxxxxxxx]
>

Hi,

> I have to remove a particular attribute (in following example it
> is "href") from all the ChildNodes of the particular node.
>
> I tried to write template something as follows:
>
> <xsl:template
> match="//body/namespace/form/snip/csf/td[position()=1]/table[posit
> ion()=2]">
> 	<xsl:apply-templates select="@*"/>
> 	<xsl:attribute name="href"/>

AFAIK, xsl:attribute is not a self-closing element, so if you really want to
create an empty href attribute, at least there should be
<xsl:attribute name="href"></xsl:attribute>

Although, I'm not sure whether this will work... (haven't needed or tested
anything like it)

If you just want to omit the href attribute from being output, you have two
options:

For both: remove the 'empty' xsl:attribute element you specified above. It
serves no purpose.

1. replace <xsl:apply-templates select="@*" /> by
   <xsl:apply-templates select="@*[not(name()='href')]" />

2. keep the current form of the apply-templates instruction, and define a
null template matching @href, like <xsl:template match="@href" />


Hope this helps!

Greetz,

Andreas

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.