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

Re: Flatten a node set into a single string

Subject: Re: Flatten a node set into a single string
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 7 Dec 2018 14:36:19 -0000
Re:  Flatten a node set into a single string
On Fri, Dec 07, 2018 at 02:16:33PM -0000, Rick Quatro rick@xxxxxxxxxxxxxx scripsit:
[snip]
> title/text()
> 
> I get a sequence of text nodes. What I really want is a single string:
> 
> 1914-1918 - World War One

title/normalize-space() should do it.  (But might have trouble if there
are two processing instructions with a space between them in the middle
of a word, or something like that.)

It can often be better to use the identity transform first to delete all
the processing instructions and get text node merging to fix nigh-all of
the line break problem before doing the main processing.

-- Graydon

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.