<?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>6559</bug_id>
          
          <creation_ts>2009-02-11 17:31:04 +0000</creation_ts>
          <short_desc>[XPath] PI name test must require string literals that satisfy NCName rules</short_desc>
          <delta_ts>2009-03-18 10:09:13 +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>XPath 2.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>REMIND</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="Tim Mills">tim</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>jim.melton</cc>
    
    <cc>jmdyck</cc>
    
    <cc>mike</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>23648</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2009-02-11 17:31:04 +0000</bug_when>
    <thetext>Bug 5351 closed following the resolution of the bug with the text

&quot;The name test shown in this bug report will always result in a dynamic error. 
In its teleconference on 2008-01-08, the WG decided (because the error, caused
by a string literal, can be caught statically) to make it a type error
(XPTY0004) if the string literal of a PI name test cannot be converted to an
NCName.&quot;

To resolve Bug 6238, could you please clarify whether

&quot;...PI name test cannot be converted to an NCName.&quot;

means that

processing-instruction(&quot;b &quot;)

raises XPTY0004, or is equivalent to 

processing-instruction(&quot;b&quot;)

because &quot;b &quot; can be converted to an NCName using xs:NCName(&quot;b &quot;).

It would seem reasonable that the normaliztion rules for constructed processing instructions would be updated along the lines of:

[processing-instruction StringLiteral{ Expr }]Expr
==
processing-instruction { xs:NCName(StringLiteral) }{ fs:item-sequence-to-untypedAtomic-PI(( [Expr]Expr)) }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23657</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2009-02-11 21:20:06 +0000</bug_when>
    <thetext>&gt; It would seem reasonable that the normaliztion rules for constructed
&gt; processing instructions would be updated along the lines of:
&gt; 
&gt; [processing-instruction StringLiteral{ Expr }]Expr
&gt; ==
&gt; processing-instruction { xs:NCName(StringLiteral) }{
&gt; fs:item-sequence-to-untypedAtomic-PI(( [Expr]Expr)) }

So far, the discussion (in the referenced bugs) has been about PITest.
Are you sure you want to bring in CompPIConstructor?

Also, note that there&apos;s no such syntax as
    processing-instruction StringLiteral { Expr }
You&apos;re maybe thinking of
    processing-instruction { StringLiteral } { Expr }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23667</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2009-02-12 10:34:53 +0000</bug_when>
    <thetext>Sorry, yes - I had meant the node test.

That said, normalizing the string literal of a CompPIConstructor with xs:NCName doesn&apos;t seem like too bad an idea...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23681</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-02-12 17:34:44 +0000</bug_when>
    <thetext>Changed component to XPath.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23682</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-02-12 17:41:36 +0000</bug_when>
    <thetext>Thed XSL WG had no strong views on whether whitespace should be allowed, but decided on balance that it should - i.e. it should be the same rules as the xs:NCName() constructor function.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23880</commentid>
    <comment_count>5</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2009-02-23 17:14:21 +0000</bug_when>
    <thetext>At today&apos;s F2F, the WG agreed to adopt this.

We will check the target to make sure it is a valid NCName. Whitespace is allowed, we use whitespace normalization before testing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23885</commentid>
    <comment_count>6</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2009-02-23 19:10:11 +0000</bug_when>
    <thetext>*** Bug 5355 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23887</commentid>
    <comment_count>7</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2009-02-23 19:12:52 +0000</bug_when>
    <thetext>*** Bug 5351 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24309</commentid>
    <comment_count>8</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2009-03-18 09:29:34 +0000</bug_when>
    <thetext>This fixes the problem:

processing-instruction(N) matches any processing-instruction node whose name (called its &quot;PITarget&quot; in XML) is equal to fn:normalize-space(N), which must be
an NCName.

It can be made less awkward by referring to the target property from our data model:

processing-instruction(N) matches any processing-instruction node whose target property is equal to fn:normalize-space(N), which must be an NCName.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>24310</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-03-18 10:09:13 +0000</bug_when>
    <thetext>&gt;which must be an NCName

The result of normalize-space() will never be an NCName. You mean &quot;which must be castable as an NCName&quot; or &quot;which must have the lexical form of an NCName&quot;.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>