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

Re: Unanticipated Results from text()

Subject: Re: Unanticipated Results from text()
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Mon, 26 Feb 2007 18:14:27 +0100
Re:  Unanticipated Results from text()
Signature House wrote:

No matter how many line-breaks are in the XML, or where they're placed, in IE the "normalize-space(text())" picks up the "B2" text
as I expected. But FileMaker/Xalan/Xerces won't pick up the "B2" text if a line-break appears between the <BBB><CCC>. I just tried
the other white-space characters (blank and tab) and the same thing happened. No white-space between the <BBB><CCC>,
FM//Xalan/Xerces get the "B2", any white-space between <BBB><CCC>, FM//Xalan/Xerces doesn't get the "B2" text.

The problem is that you call e.g.
normalize-space(text())
so you call normalize-space on a node set of all child text nodes. That way you normalize white space in the first text node in the node set as converting the node set to a string takes the string of the first node only. I think what you want instead is e.g.
<xsl:for-each select="text()">
<xsl:value-of select="normalize-space()"/>
</xsl:for-each>


--

	Martin Honnen
	http://JavaScript.FAQTs.com/

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.