xsl-list
[Top] [All Lists]

Re: [xsl] When to use text()

2014-03-21 12:44:44
On Fri, Mar 21, 2014 at 5:40 PM, Graydon <graydon(_at_)marost(_dot_)ca> wrote:
On Fri, Mar 21, 2014 at 05:19:32PM +0000, Ihe Onwuka scripsit:
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.

There isn't, though.  text nodes have no name and a string and no node
children.

Text nodes are guaranteed leaves, like everything else except for
element nodes and document nodes.

The quirkiness derives from giving it an innocuous intuit inducing
moniker like text() that leads the consumer astray.

Let me parallel. If you call a concept Nothing and then occasionally
allow it to contain Something, RTFTM is not appropriate because the
fault lies in labelling that concept Nothing.

But it doesn't.  The parent element does.  The issue is not that there
might be a comment node in the text node, but that there might be a
comment node child of the parent element node that separates the string
contents of the element into two or more text node children.


If it's a guaranteed leaf you shouldn't get the contents of anything
else when you ask for it.

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