xsl-list
[Top] [All Lists]

Re: [xsl] When to use text()

2014-03-22 03:42:13
On 21/03/2014 17:44, Ihe Onwuka wrote:
The quirkiness of the definition derives not from the definition
itself, because there may well be justification for the
existence of a node type that encompasses text with embedded
comments. Thats OK.


text nodes are leaves: they never have embedded comments. Your complaint
appears to be just a complete misunderstanding of what text() returns
(which is never anything with a comment in it). It's OK to misunderstand
the language but rather odd to assert that your misunderstanding is due
to a failure in the language definition.



Perhaps you'd want it to do what string() does but that's called
string() not text():-)


You see there right where the smiley is, is where we differ. I don't
see that as anything to smile about. To me thats just thats a smart
alec distinction.

The distinction is fundamental to the use of XPath. text() returns a
sequence of text nodes, you can ask for their identity, their parent and
sibling nodes etc. string() (which appears to be the function you
wanted) returns a _string_ which is an atomic value dissociated from any
document tree. The distinction between atomic values and nodes pervades
all uses of XSLT and XPath.


David


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