<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>4169</bug_id>
          
          <creation_ts>2007-01-09 18:25:12 +0000</creation_ts>
          <short_desc>[UPD] Renaming PI using QName</short_desc>
          <delta_ts>2007-01-30 13:01:54 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Update Facility</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="John Snelson">john.snelson</reporter>
          <assigned_to name="Andrew Eisenberg">andrew.eisenberg</assigned_to>
          <cc>martin</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>13386</commentid>
    <comment_count>0</comment_count>
    <who name="John Snelson">john.snelson</who>
    <bug_when>2007-01-09 18:25:12 +0000</bug_when>
    <thetext>Section 3.1.11.3 of the specification says that a processing instruction&apos;s name is set to the value of an object of type xs:QName. Since a processing instruction&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13429</commentid>
    <comment_count>1</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2007-01-10 22:56:23 +0000</bug_when>
    <thetext>Answering as an individual, I think that I&apos;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:

&quot;If the resulting XDM instance violates any constraint specified in
[XQuery/XPath Data Model (XDM)], a dynamic error is raised [err:XUDY0021].&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13442</commentid>
    <comment_count>2</comment_count>
    <who name="John Snelson">john.snelson</who>
    <bug_when>2007-01-11 11:14:21 +0000</bug_when>
    <thetext>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&apos;t got a prefix set, but has picked up a default namespace from somewhere.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13508</commentid>
    <comment_count>3</comment_count>
    <who name="Martin Probst">martin</who>
    <bug_when>2007-01-12 22:44:48 +0000</bug_when>
    <thetext>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 &lt;?pi?&gt; as node-name(&lt;?pooh?&gt;)

should work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13832</commentid>
    <comment_count>4</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2007-01-29 22:25:19 +0000</bug_when>
    <thetext>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 &quot;Closed.&quot;

Regards,
Don Chamberlin (for the Query Working Group)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>