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

[Bug 4151] XQTY0086 description is too limited

From: <bugzilla@wiggum.w3.org>
Date: Fri, 05 Jan 2007 21:14:56 +0000
To: public-qt-comments@w3.org
Message-Id: <E1H2wOu-0006Ge-LR@wiggum.w3.org>


           Summary: XQTY0086 description is too limited
           Product: XPath / XQuery / XSLT
           Version: Proposed Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery
        AssignedTo: chamberl@almaden.ibm.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org

One of my users is struggling with the problem of how to use XQuery to make an
amended copy of elements with namespace-sensitive content. It really isn't easy
(in fact, I don't think it's possible in general); but that's a subject for
vendor extensions now and for XQuery 1.1 in due course.

Meanwhile, there's a situation that the spec doesn't seem to address. Consider
the construct

element { node-name($t) } {
    $e/@*, $e/*

where construction mode is preserve, and one of the attributes is typed as a
QName. I think this should give error XQTY0086. But the current description of
XQTE0086 is too narrow. It says:

It is a type error [err:XQTY0086] in this case [where copy-namespaces mode
specifies no-preserve] if the typed value of the copied element or of any of
its attributes is namespace-sensitive.

But in this example the namespace-sensitive attribute does not belong to a
copied element, and that's a problem regardless of the copy-namespaces mode.

The equivalent XSLT error condition is wider:

[ERR XTTE0950] It is a type error to use the xsl:copy or xsl:copy-of
instruction to copy a node that has namespace-sensitive content if the
copy-namespaces attribute has the value no and its explicit or implicit
validation attribute has the value preserve. It is also a type error if either
of these instructions (with validation="preserve") is used to copy an attribute
having namespace-sensitive content, unless the parent element is also copied. A
node has namespace-sensitive content if its typed value contains an item of
type xs:QName or xs:NOTATION or a type derived therefrom. The reason this is an
error is because the validity of the content depends on the namespace context
being preserved.

I think this needs a new clause, perhaps between D and E, along the lines:

D2 If construction mode is preserve, and the value of an enclosed expression
includes an attribute node whose typed value is namespace-sensitive, then error
[err:XQTY0086] is raised.
Received on Friday, 5 January 2007 21:15:20 UTC

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