<?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>28638</bug_id>
          
          <creation_ts>2015-05-14 15:22:58 +0000</creation_ts>
          <short_desc>[QT3] innermost-020 permutation assertion does not include all allowed outcomes</short_desc>
          <delta_ts>2015-06-16 17:05:32 +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>XQuery 3 &amp; XPath 3 Test Suite</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</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="Abel Braaksma">abel.braaksma</reporter>
          <assigned_to name="O&apos;Neil Delpratt">oneil</assigned_to>
          <cc>mike</cc>
    
    <cc>vitaliy.yudenkov</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>120304</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-05-14 15:22:58 +0000</bug_when>
    <thetext>The test innermost020 tests the namespace nodes in position 17 to 20 with the fn:innermost function.

Positions 17 to 19 are in the element &lt;level&gt;.
Position 20 is in the element &lt;empty-level&gt;.

Because the order of namespaces is undefined, it is unclear what set is selected from the 4 namespace nodes in element &lt;level&gt; and which single namespace node is selected from &lt;empty-level&gt;. 

Suggested fix: select 16 to 19 instead, or add other possible permutations.

I created a list of namespaces and their corresponding document positions for ease of analysis (truncated), note positions 17 to 20:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;root count=&quot;1&quot;&gt;
   &lt;namespace-in-scope pos=&quot;1&quot; prefix=&quot;xmlns:level0&quot;/&gt;
   &lt;namespace-in-scope pos=&quot;2&quot; prefix=&quot;xmlns:xml&quot;/&gt;
   &lt;empty-level-0 count=&quot;2&quot;&gt;
      &lt;namespace-in-scope pos=&quot;3&quot; prefix=&quot;xmlns:xml&quot;/&gt;
      &lt;namespace-in-scope pos=&quot;4&quot; prefix=&quot;xmlns:level0&quot;/&gt;
   &lt;/empty-level-0&gt;
   &lt;non-empty-level-0 count=&quot;3&quot;&gt;
      &lt;namespace-in-scope pos=&quot;5&quot; prefix=&quot;xmlns:xml&quot;/&gt;
      &lt;namespace-in-scope pos=&quot;6&quot; prefix=&quot;xmlns:level0&quot;/&gt;
   &lt;/non-empty-level-0&gt;
   &lt;level count=&quot;4&quot;&gt;
      &lt;namespace-in-scope pos=&quot;7&quot; prefix=&quot;xmlns:level00&quot;/&gt;
      &lt;namespace-in-scope pos=&quot;8&quot; prefix=&quot;xmlns:xml&quot;/&gt;
      &lt;namespace-in-scope pos=&quot;9&quot; prefix=&quot;xmlns:level0&quot;/&gt;
      &lt;empty-level-00 count=&quot;5&quot;&gt;
         &lt;namespace-in-scope pos=&quot;10&quot; prefix=&quot;xmlns:xml&quot;/&gt;
         &lt;namespace-in-scope pos=&quot;11&quot; prefix=&quot;xmlns:level00&quot;/&gt;
         &lt;namespace-in-scope pos=&quot;12&quot; prefix=&quot;xmlns:level0&quot;/&gt;
      &lt;/empty-level-00&gt;
      &lt;non-empty-level-00 count=&quot;6&quot;&gt;
         &lt;namespace-in-scope pos=&quot;13&quot; prefix=&quot;xmlns:xml&quot;/&gt;
         &lt;namespace-in-scope pos=&quot;14&quot; prefix=&quot;xmlns:level00&quot;/&gt;
         &lt;namespace-in-scope pos=&quot;15&quot; prefix=&quot;xmlns:level0&quot;/&gt;
      &lt;/non-empty-level-00&gt;
      &lt;level count=&quot;7&quot;&gt;
         &lt;namespace-in-scope pos=&quot;16&quot; prefix=&quot;xmlns:level000&quot;/&gt;
         &lt;namespace-in-scope pos=&quot;17&quot; prefix=&quot;xmlns:xml&quot;/&gt;
         &lt;namespace-in-scope pos=&quot;18&quot; prefix=&quot;xmlns:level00&quot;/&gt;
         &lt;namespace-in-scope pos=&quot;19&quot; prefix=&quot;xmlns:level0&quot;/&gt;
         &lt;empty-level-000 count=&quot;8&quot;&gt;
            &lt;namespace-in-scope pos=&quot;20&quot; prefix=&quot;xmlns:xml&quot;/&gt;
            &lt;namespace-in-scope pos=&quot;21&quot; prefix=&quot;xmlns:level000&quot;/&gt;
            &lt;namespace-in-scope pos=&quot;22&quot; prefix=&quot;xmlns:level00&quot;/&gt;
            &lt;namespace-in-scope pos=&quot;23&quot; prefix=&quot;xmlns:level0&quot;/&gt;
         &lt;/empty-level-000&gt;
         &lt;non-empty-level-000 count=&quot;9&quot;&gt;
            &lt;namespace-in-scope pos=&quot;24&quot; prefix=&quot;xmlns:xml&quot;/&gt;
            &lt;namespace-in-scope pos=&quot;25&quot; prefix=&quot;xmlns:level000&quot;/&gt;
            &lt;namespace-in-scope pos=&quot;26&quot; prefix=&quot;xmlns:level00&quot;/&gt;
            &lt;namespace-in-scope pos=&quot;27&quot; prefix=&quot;xmlns:level0&quot;/&gt;
         &lt;/non-empty-level-000&gt;
      &lt;/level&gt;
   &lt;/level&gt;
   &lt;.....truncated....&gt;
&lt;/...&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120317</commentid>
    <comment_count>1</comment_count>
    <who name="Vitaliy">vitaliy.yudenkov</who>
    <bug_when>2015-05-15 11:21:08 +0000</bug_when>
    <thetext>Similar issue happens with the [QT3]outermost-020 test:
fn:outermost( //*/namespace::* )[position() = (17 to 20)] ! local-name()

It shares the same environment as innermost-020.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121105</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-06-16 16:54:59 +0000</bug_when>
    <thetext>I agree, it would be better to select (16 to 19).

Saxon passes this test by accident. Here are the relevant namespace nodes as shown by Saxon:

   &lt;n pos=&quot;16&quot; pre=&quot;level000&quot; uri=&quot;level:000&quot; parent=&quot;level&quot;/&gt;
   &lt;n pos=&quot;17&quot; pre=&quot;level00&quot; uri=&quot;level:00&quot; parent=&quot;level&quot;/&gt;
   &lt;n pos=&quot;18&quot; pre=&quot;level0&quot; uri=&quot;level:0&quot; parent=&quot;level&quot;/&gt;
   &lt;n pos=&quot;19&quot; pre=&quot;xml&quot; uri=&quot;http://www.w3.org/XML/1998/namespace&quot; parent=&quot;level&quot;/&gt;
   &lt;n pos=&quot;20&quot; pre=&quot;level000&quot; uri=&quot;level:000&quot; parent=&quot;empty-level-000&quot;/&gt;
   &lt;n pos=&quot;21&quot; pre=&quot;level00&quot; uri=&quot;level:00&quot; parent=&quot;empty-level-000&quot;/&gt;
   &lt;n pos=&quot;22&quot; pre=&quot;level0&quot; uri=&quot;level:0&quot; parent=&quot;empty-level-000&quot;/&gt;
   &lt;n pos=&quot;23&quot; pre=&quot;xml&quot; uri=&quot;http://www.w3.org/XML/1998/namespace&quot; parent=&quot;empty-level-000&quot;/&gt;

For reference here is the stylesheet used to produce this list:

&lt;xsl:stylesheet exclude-result-prefixes=&quot;#all&quot; version=&quot;2.0&quot;
	xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;
	&lt;xsl:output indent=&quot;yes&quot; saxon:line-length=&quot;120&quot; xmlns:saxon=&quot;http://saxon.sf.net/&quot;/&gt;
	&lt;xsl:template  name=&quot;main&quot;&gt;
		&lt;out&gt;
		&lt;xsl:for-each select=&quot;doc(&apos;file:///Users/mike/w3c/qt3t/QT3-test-suite/fn/innermost/innermost.xml&apos;)//namespace::*&quot;&gt;
			&lt;n pos=&quot;{position()}&quot; pre=&quot;{name()}&quot; uri=&quot;{string(.)}&quot; parent=&quot;{name(..)}&quot;/&gt;
		&lt;/xsl:for-each&gt;
		&lt;/out&gt;
	&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121106</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-06-16 17:05:32 +0000</bug_when>
    <thetext>Fixed both tests (changed the range to 16..19)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>