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

Re: [xsl] When to use text()

Subject: Re: [xsl] When to use text()
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxx>
Date: Fri, 21 Mar 2014 14:04:33 -0400


On Fri, Mar 21, 2014 at 1:40 PM, Graydon <graydon@xxxxxxxxx> 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

Current Thread