[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] When to use text()


Subject: Re: [xsl] When to use text()
From: David Sewell <dsewell@xxxxxxxxxxxx>
Date: Fri, 21 Mar 2014 11:15:28 -0400 (EDT)

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@xxxxxxxxxxxxxxx> 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.



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


Current Thread
Keywords