xsl-list
[Top] [All Lists]

Re: [xsl] When to use text()

2014-03-21 13:04:52
Hi,

On Fri, Mar 21, 2014 at 1:40 PM, Graydon <graydon(_at_)marost(_dot_)ca> wrote:
(In this particular case; whitespace text nodes and comments and
processing instructions can throw a lot more than that off if you
suppose they're never there.)

Exactly. I think the problem is deeper than the name of text(). They
could have named it text-node(), which might have exposed the issue
better, but it wouldn't have solved it. (Instead of the beginners
jumping to incorrect conclusions, they'd go "huh?", and then jump to
incorrect conclusions.) The deeper problem is the much more common
one, that we don't like being surprised when things are different and
more complicated than we imagined going in. Why do we have comments,
PIs, or mixed content at all? They are such a pain. (Because it's a
*markup language*, Sweetie.)

Then, I suppose, it's nice to have someone else to blame. James Clark
and Steven J. DeRose! If only the XPath 1.0 Rec had correctly
anticipated what I am thinking today, this entire problem could have
been avoided!

Or, there's an alternative approach. Heiko, who started this thread,
demonstrated it. Stay alert, don't assume all your guesses must be
correct, and ask questions.

Cheers, Wendell

-- 
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^

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