W3C home > Mailing lists > Public > public-qt-comments@w3.org > October 2010

[Bug 10982] [DM11] RFE: Retrieving the typed-value that a Text Node represents

From: <bugzilla@jessica.w3.org>
Date: Wed, 06 Oct 2010 08:17:22 +0000
To: public-qt-comments@w3.org
Message-Id: <E1P3PBi-0006mq-KZ@jessica.w3.org>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=10982

Michael Kay <mike@saxonica.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mike@saxonica.com

--- Comment #1 from Michael Kay <mike@saxonica.com> 2010-10-06 08:17:21 UTC ---
This seems a bad idea to me.

There are a lot of queries that do things like

employee/salary/text()

(This is particularly prevalent in the XQuery community, because the style has
been encouraged by tutorials, often for poor reasons.)

There are two reasons people might write this:

(a) because they actually want the text nodes, as distinct from the typed value
of the salary (for example, because they want to control the impact of comments
and processing instructions appearing among the text nodes)

(b) because they are copying blindly from a book and didn't realise that
writing employee/salary would have been more appropriate.

Either way, your proposed change would break this query.

Quite apart from compatibility, I think there are good reasons for the spec
being the way it is. Only elements and attributes have a type annotation; text
nodes do not. Your proposal would raise many questions about what happens, for
example, when a text node is copied from one element to another.

(But personally, I think the idea of storing the typed value rather than the
string value is usually a bad idea anyway.)

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Wednesday, 6 October 2010 08:17:24 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:44 UTC