This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Deleting following sibling element


From: "Michael Kay" <mhkay@iclway.co.uk>
To: <xsl-list@lists.mulberrytech.com>
Subject: RE: [xsl] 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]