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 28638 - [QT3] innermost-020 permutation assertion does not include all allowed outcomes
Summary: [QT3] innermost-020 permutation assertion does not include all allowed outcomes
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: O'Neil Delpratt
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-14 15:22 UTC by Abel Braaksma
Modified: 2015-06-16 17:05 UTC (History)
2 users (show)

See Also:


Attachments

Description Abel Braaksma 2015-05-14 15:22:58 UTC
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 <level>.
Position 20 is in the element <empty-level>.

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

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:

<?xml version="1.0" encoding="UTF-8"?>
<root count="1">
   <namespace-in-scope pos="1" prefix="xmlns:level0"/>
   <namespace-in-scope pos="2" prefix="xmlns:xml"/>
   <empty-level-0 count="2">
      <namespace-in-scope pos="3" prefix="xmlns:xml"/>
      <namespace-in-scope pos="4" prefix="xmlns:level0"/>
   </empty-level-0>
   <non-empty-level-0 count="3">
      <namespace-in-scope pos="5" prefix="xmlns:xml"/>
      <namespace-in-scope pos="6" prefix="xmlns:level0"/>
   </non-empty-level-0>
   <level count="4">
      <namespace-in-scope pos="7" prefix="xmlns:level00"/>
      <namespace-in-scope pos="8" prefix="xmlns:xml"/>
      <namespace-in-scope pos="9" prefix="xmlns:level0"/>
      <empty-level-00 count="5">
         <namespace-in-scope pos="10" prefix="xmlns:xml"/>
         <namespace-in-scope pos="11" prefix="xmlns:level00"/>
         <namespace-in-scope pos="12" prefix="xmlns:level0"/>
      </empty-level-00>
      <non-empty-level-00 count="6">
         <namespace-in-scope pos="13" prefix="xmlns:xml"/>
         <namespace-in-scope pos="14" prefix="xmlns:level00"/>
         <namespace-in-scope pos="15" prefix="xmlns:level0"/>
      </non-empty-level-00>
      <level count="7">
         <namespace-in-scope pos="16" prefix="xmlns:level000"/>
         <namespace-in-scope pos="17" prefix="xmlns:xml"/>
         <namespace-in-scope pos="18" prefix="xmlns:level00"/>
         <namespace-in-scope pos="19" prefix="xmlns:level0"/>
         <empty-level-000 count="8">
            <namespace-in-scope pos="20" prefix="xmlns:xml"/>
            <namespace-in-scope pos="21" prefix="xmlns:level000"/>
            <namespace-in-scope pos="22" prefix="xmlns:level00"/>
            <namespace-in-scope pos="23" prefix="xmlns:level0"/>
         </empty-level-000>
         <non-empty-level-000 count="9">
            <namespace-in-scope pos="24" prefix="xmlns:xml"/>
            <namespace-in-scope pos="25" prefix="xmlns:level000"/>
            <namespace-in-scope pos="26" prefix="xmlns:level00"/>
            <namespace-in-scope pos="27" prefix="xmlns:level0"/>
         </non-empty-level-000>
      </level>
   </level>
   <.....truncated....>
</...>
Comment 1 Vitaliy 2015-05-15 11:21:08 UTC
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.
Comment 2 Michael Kay 2015-06-16 16:54:59 UTC
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:

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

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

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