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

RE: Deleting following sibling element

Subject: RE: Deleting following sibling element
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx (by way of B. Tommie Usdin)
Date: Thu, 18 Jan 2001 18:26:10 -0500
RE:  Deleting following sibling element
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE:  Deleting following sibling element
Date: Wed, 17 Jan 2001 09:28:16 -0000
Message-ID: <000501c08068$b2fdb760$0100007f@mhkhome>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
In-Reply-To: <a0500190bb68a9e7f363e@[209.179.157.251]>
Importance: Normal

 Does anybody knows how can I delete an element that is the next
 following-sibling of the context node?

XSLT's model is one of selectively copying data from the source to the result, so it's not clear what you mean by "delete". The node won't be copied unless you ask for it to be copied, and if you don't want it to appear in the output then you must find the code that was copying it and change it.

For example: [XML] <a href="anything">link</a><br/>

 [XSL]
 <xsl:template match="//a[name(following-sibling::*[1])='br']">

????

</xsl:template>

 [The XML Output should be]
 <a href="anything">link</a>

If you want to not-copy a <br> that is preceded by an <a>, write:


<xsl:template match="br[preceding-sibling::*[1][self::a]"/>

Alternatively, ensure that your stylesheet doesn't do an apply-templates on
this element in the first place.

Mike Kay

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


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.