[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 Carlisle <davidc@xxxxxxxxx>
Date: Sun, 23 Mar 2014 18:01:30 +0000

On 23/03/2014 17:52, Ihe Onwuka wrote:

What on earth is that? "text" in English might mean "a book" or several other meanings. I actually can't think of a programming language that has a "text" type. Xpath has a string type (for which you want string() or more usually the implicit implied string value) and text nodes (which you want text() )

I note you have consistently failed to say what you think the actual
definition should have been, or how that definition would have been more

In (a real, valid MathML) example

<cn> 1 <sep/> 2 </cn>

There are three child nodes of cn, two text and one element.

$cn/text() returns the sequence of text nodes (" 1 ", " 2 ") (that is
the real and imaginary parts of the number.

Your one word non-answer gives no indication of what value you think
would have been a more intuitive definition of text() or what $cn/text()
should return, (given that element() returns element nodes attribute()
returns attribute nodes and comment() returns comment nodes.


Current Thread