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

Getting a list of node Text()

Subject: Getting a list of node Text()
From: Nicholas Orr <nick@xxxxxxxxxxx>
Date: Wed, 20 Jun 2007 08:45:28 +1000
 Getting a list of node Text()
G'day all,

I've got some XSLT that gets a nodes text value that works fine. But the data I'm getting is changing a lot and I want to have a dynamic approach to listing all of the nodes I'm after instead of having to alter the XSLT each time.

Essentially I'm trying to get a <Calculation> node which will be a child node of the current one. But the issue is that there will sometimes be one calculation node, and sometimes multiple nodes. And they're not always just child nodes, they might be sub child nodes. So I might have for my path :

./Calculation

or

./Value/Calculation
./StartPosition/Calculation

or multiple Calculation nodes in multiple places. My thought was that I'd set a variable and make it empty, then do a for-each descendant::Calculation loop to get each one, and "concat($calc,text ())" them to the variable.

Does anyone know of an easier way? The other issue I have is that if the node is empty, I want to ignore it, and each node should be separated by a return character.

Thanks,
Nick

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.