xsl-list
[Top] [All Lists]

Re: [xsl] When to use text()

2014-03-21 10:15:46
I wonder how much of the problem (and there is one, at least for beginning users of XPath/XQuery/XSLT, and it even bites old hands sometimes) is owing to the fact that the XPath syntax for an axis step followed by a node type is identical to the syntax for an axis step followed by a single-argument function.

        $node/text()

looks just like

        $node/string()

even though the underlying semantics are quite different. I suspect that mentally one tends to conflate the two. (Applying the Sapir-Whorf hypothesis to programming languages, i.e. the way a language encodes things influences the way we think about them.)

David


On Fri, 21 Mar 2014, Ihe Onwuka wrote:

On Fri, Mar 21, 2014 at 2:20 PM, Wendell Piez 
<wapiez(_at_)wendellpiez(_dot_)com> wrote:
Hi,

To gloss Mike ...

Yes, text() is over-used and commonly misused.


I wouldn't be blaming the programmers for that.

When you step back, it is clear from all the explanations given, that
the thing doesn't do what it says on the tin.

--~------------------------------------------------------------------
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>
--~--



--
David Sewell, Editorial and Technical Manager
ROTUNDA, The University of Virginia Press
PO Box 400314, Charlottesville, VA 22904-4314 USA
Email: dsewell(_at_)virginia(_dot_)edu   Tel: +1 434 924 9973
Web: http://rotunda.upress.virginia.edu/

--~------------------------------------------------------------------
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>