W3C home > Mailing lists > Public > public-qt-comments@w3.org > July 2007

[Bug 4874] [F&O] Casting NOTATION to String

From: <bugzilla@wiggum.w3.org>
Date: Sun, 22 Jul 2007 22:15:15 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1ICjhr-0003g3-U2@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4874

           Summary: [F&O] Casting NOTATION to String
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators
        AssignedTo: mike@saxonica.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


Casting NOTATION to String.

Section 17.1.2 says: If ST is xs:QName or xs:NOTATION:
    * if the qualified name has a prefix TV is (fn:concat(fn:prefix-from-QName(
SV), ":", fn:local-name-from-QName( SV)).

A literal reading of this says that if the NOTATION has a prefix, the result is
a type error, because fn:prefix-from-QName() cannot be applied to a NOTATION. I
don't think this is the interpretation that is intended. Since this expression
cannot be written in XPath, I suggest rephrasing it as "if the qualified name
has a prefix TV is the concatenation of the prefix of SV, a single colon (:),
and the local name of SV".

For the future: it seems unsatisfactory that the only way of constructing a
NOTATION is from a literal string, and that there is no way of processing a
NOTATION other than converting it to a string. This makes it impossible for the
user to determine, for example, what namespace a NOTATION is in, or to ensure
that this namespace is declared when an attribute of type NOTATION is written
to the result tree. I suggest that we should allow casting between QName and
NOTATION in both directions, with the obvious semantics, making operations
defined on QNames available for constructing and deconstructing NOTATIONs.
Received on Sunday, 22 July 2007 22:15:21 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:19 UTC