[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] BOUNCE xsl-list@lists.mulberrytech.com: Admin requ
From mail@xxxxxxxxxxxxxxxx Thu Jan 11 04:51:04 2001Received: from bravo.whitburn.xcalibre.co.uk (mail@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx [194.201.48.11]) by biglist.com (8.8.8/8.8.5/BL-2) with ESMTP id EAA13550 for <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>; Thu, 11 Jan 2001 04:51:04 -0500 (EST) Received: from [194.88.81.28] (helo=TIFERET) by bravo.whitburn.xcalibre.co.uk with esmtp (Exim 3.15 #1) id 14GeAs-00045v-00; Thu, 11 Jan 2001 09:37:39 +0000 Date: Thu, 11 Jan 2001 09:46:18 +0000 From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx> X-Mailer: The Bat! (v1.49) Business Reply-To: Jeni Tennison <mail@xxxxxxxxxxxxxxxx> Organization: Jeni Tennison Consulting Ltd X-Priority: 3 (Normal) Message-ID: <462488197.20010111094618@xxxxxxxxxxxxxxxx> To: "Devlin, Kurt" <Kurt.Devlin@xxxxxxxxxxxxx> CC: xsl-list <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: Re: BOUNCE xsl-list@xxxxxxxxxxxxxxxxxxxxxx: Admin request of type /\bremove\b/i at line 1 In-reply-To: <a05001908b682f40144ff@[63\.48\.105\.105]> References: <a05001908b682f40144ff@[63.48.105.105]> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi Kurt, I need to remove some PCDATA prior to a specified element. I am rendering my XML to HTML. In the main section I want all the information shown. In the table of references that gets generated at the end of the document, I want to strip certain elements and the PCDATA that appears directly before that element.
text()[following-sibling::node()[1][self::foo]] Put that in an empty template, and it will ignore all those text elements: <xsl:template match="text()[following-sibling::node()[1][self::foo]]" mode="ToC" /> If you have more elements whose immediately preceding text you want to ignore, then you can add them to the predicate: text()[following-sibling::node()[1] [self::foo or self::bar or self::baz]] So you can get rid of text for all these elements using just one template. You say: I have created a simple example of what I want to do below. In this example it would be simple to just look at the elements that I do want, but in my real project there are too many elements that I do want. I really only want to add a couple of templates to handle ignoring the element and its preceding PCDATA.
<xsl:apply-templates select="*[not(self::foo or self::bar or self::baz)]" mode="ToC" /> This is slightly better (I think) than applying templates to all the elements and having empty templates that match those you don't want because it narrows down the nodes that the templates are applied to early on. I hope that helps, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|