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

Re: NodeTest text()

Subject: Re: NodeTest text()
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 03 Feb 2004 08:37:29 -0500
xsl nodetest
At 2004-02-03 12:06 +0000, BODARD Gabriel wrote:
I am trying to use the text() nodetest to extract the text only value of
a string. Kay (2nd ed.) defines the function of text() as "selects all
text nodes on the relevant axis".

The node test selects all, but <xsl:value-of /> only returns the value of the first node found in document order.


So, I would expect the text() content of the abbr element in:

<abbr>Will<expan>elmus</expan>s</abbr>

to be 'Wills'.

When all of the text nodes are concatenated, yes.


(This is within the definition of a key and also includes
normalise-space and translate, to complicate matters, but it should
still all work.) The trouble is that the output I get from this function
is 'Will', i.e. only the first text node, rather than all.

Right ... but then I'm assuming you are using <xsl:value-of/>


Am I
misunderstanding the definition, misusing the nodetest, or is this a
problem with Saxon?

It is not a problem with Saxon, Saxon is compliant in its returned value.


As with many sibling node issues in XSLT 1.0 you will need to walk the tree of text() node siblings concatenating the values you find into a return string value.

I hope this helps.

......................... Ken
8

--
Public courses: sign up for one or both soon to reserve your seat!
Each week:  Monday-Wednesday: XSLT/XPath;  Thursday-Friday: XSL-FO
Washington, DC: 2004-03-15           San Francisco, CA: 2004-03-22
Hong Kong, China: 2004-05-17           Bremen, Germany: 2004-05-24
World-wide on-site corporate, government & user group XML training

G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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.