This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4169 - [UPD] Renaming PI using QName
Summary: [UPD] Renaming PI using QName
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Update Facility (show other bugs)
Version: Working drafts
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-09 18:25 UTC by John Snelson
Modified: 2007-01-30 13:01 UTC (History)
1 user (show)

See Also:


Attachments

Description John Snelson 2007-01-09 18:25:12 UTC
Section 3.1.11.3 of the specification says that a processing instruction's name is set to the value of an object of type xs:QName. Since a processing instruction's name has a type of xs:NCName, at the very least the specification is missing some error handling if the given xs:QName has a namespace URI.

Better still would be specific handling that obtained the new name for the PI as an xs:NCName.
Comment 1 Andrew Eisenberg 2007-01-10 22:56:23 UTC
Answering as an individual, I think that I'll give the same answer that I gave in bug 4171. The target property for a PI node is constrained in the Data Model to be an NCName.

Section 3.2.2, upd:applyUpdates, Semantics, bullet 5, says:

"If the resulting XDM instance violates any constraint specified in
[XQuery/XPath Data Model (XDM)], a dynamic error is raised [err:XUDY0021]."
Comment 2 John Snelson 2007-01-11 11:14:21 UTC
There is no president for converting an xs:QName to an xs:NCName in any of the XQuery specifications, and so I feel this needs to be discussed. Their are certainly two acceptable methods that I can think of:

1) Take the localname from the QName, and ignore the prefix and URI.
2) Take the localname from the QName, but raise an error if there is a prefix or URI present.

You might also want to consider an xs:QName that hasn't got a prefix set, but has picked up a default namespace from somewhere.
Comment 3 Martin Probst 2007-01-12 22:44:48 UTC
I actually thought the reason for this rename operation taking a QName is that functions like fn:node-name() return xs:QNames. Even if that was not the reason, I think it would be a very good reason:

do rename <?pi?> as node-name(<?pooh?>)

should work.
Comment 4 Don Chamberlin 2007-01-29 22:25:19 UTC
John,
Thanks for your comment, which was considered by the Query Working Group on Jan 29, 2007. We agree that XQuery should specify what happens when a rename expression attempts to give a PI node a QName with a non-empty prefix. The working group feels that this case should be treated as an error, and will define a new error code for this purpose.

If you are satisfied with this resolution, please mark this bug report as "Closed."

Regards,
Don Chamberlin (for the Query Working Group)