xsl-list
[Top] [All Lists]

RE: text() handling

2005-01-14 09:48:02
Thanks, Jon. I just finished reading that. I refer to
http://www.topxml.com/xsl/funcnormalize-space.asp as my cheatsheet. But
overlooked this function for some reason. Perhaps, newbie syndrom.

Douglas Ross
Developer, HTML UI Framework
Kronos
E-mail: dross(_at_)kronos(_dot_)com
Voice: (978) 947-4305
Fax: (978) 256-2474
www.kronos.com
Smaller, Faster, Sharper, Easier(tm)

-----Original Message-----
From: Jon Gorman [mailto:jonathan(_dot_)gorman(_at_)gmail(_dot_)com] 
Sent: Friday, January 14, 2005 11:39 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] text() handling

Hi Douglas,

<anode>   foo   bar   </anode>

What would normalize-space do to the above node?
'foo bar', ' foo bar ', 'foo   bar'.

It would be 'foo bar'.  If you want to know the specifics, see below.

From the XPATH  1.0 Spec (see http://www.w3.org/TR/xpath):

Function: string normalize-space(string?)

The normalize-space function returns the argument string with
whitespace normalized by stripping leading and trailing whitespace and
replacing sequences of whitespace characters by a single space.
Whitespace characters are the same as those allowed by the S
production in XML. If the argument is omitted, it defaults to the
context node converted to a string, in other words the string-value of
the context node.

It looks like XPath 2.0 working draft keeps to this definion.

Jon Gorman

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>