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

Re: Getting all the text of an element, except for one

Subject: Re: Getting all the text of an element, except for one type
From: "Imsieke, Gerrit, le-tex gerrit.imsieke@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 9 Feb 2024 14:10:40 -0000
Re:  Getting all the text of an element
Hi Rick,

Martin's and Syd's approaches using detailed template matches are preferable, but let me just point out what you were missing.

Let me paraphrase the expression slightly:

title/descendant-or-self::* except ./data

where . is the section element that the template matches.

But section has no data children.

You could phrase it differently, yet slightly inefficiently:

title/descendant-or-self::* except title/descendant::data

or use a predicate:

title/descendant-or-self::*[not(self::data)]

But still you'd get duplicate strings: The string value of title, plus the string value of the contained ph element.

So this won't lead to anything useful, and I, too, recommend an idiomatic template matching approach.

Gerrit

On 09.02.2024 14:57, rick@xxxxxxxxxxxxxx wrote:
B B B B <xsl:template match="section">

B B B B B B B <entry><xsl:value-of select="title/descendant-or-self::* except data"/></entry>

B B B </xsl:template>


-- Gerrit Imsieke GeschC$ftsfC<hrer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke@xxxxxxxxx, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

GeschC$ftsfC<hrer / Managing Directors:
Gerrit Imsieke, Svea Jelonek, Thomas Schmidt

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.