fn:outermost bug?

Sunday, 16 November 2014 · 4 messages
MG
Marc van Grootel16 Nov 2014 12:51 #
Hi, I think I bumped into a bug (on 8.0 snapshot)
  let $input :=
    <ul>
      <li id="first">item 1</li>
      <li>item 2</li>
      <li id="last">item 3</li>
    </ul>

   return
      outermost((
          $input//li[@id = 'last'],
          $input//li,
          $input//li[@id = 'first']
      ))
=>
  <li id="first">item 1</li>
  <li>item 2</li>
  <li id="last">item 3</li>
  <li id="last">item 3</li>
  <li id="last">item 3</li>
This is in document order but duplicates are not eliminated. The same happens with fn:innermost. According to the spec[1] "takes as input a sequence of nodes, and returns every node within the sequence that does not have another node within the sequence as an ancestor; the nodes are returned in document order with duplicates eliminated." [1] http://www.w3.org/TR/xpath-functions-30/#func-outermost --Marc
MG
Marc van Grootel16 Nov 2014 12:56 #
... even weirder, it returns li/@id=last three times --Marc
Quoted text · Marc van Grootel · 39 lines
On Sun, Nov 16, 2014 at 12:51 PM, Marc van Grootel <marc.van.grootel at gmail.com> wrote: > Hi, > > I think I bumped into a bug (on 8.0 snapshot) > > let $input := > <ul> > <li id="first">item 1</li> > <li>item 2</li> > <li id="last">item 3</li> > </ul> > > return > outermost(( > $input//li[@id = 'last'], > $input//li, > $input//li[@id = 'first'] > )) > > => > > <li id="first">item 1</li> > <li>item 2</li> > <li id="last">item 3</li> > <li id="last">item 3</li> > <li id="last">item 3</li> > > This is in document order but duplicates are not eliminated. The same > happens with fn:innermost. > > According to the spec[1] "takes as input a sequence of nodes, and > returns every node within the sequence that does not have another node > within the sequence as an ancestor; the nodes are returned in document > order with duplicates eliminated." > > [1] http://www.w3.org/TR/xpath-functions-30/#func-outermost > > --Marc
-- --Marc
CG
Christian Grün16 Nov 2014 13:57 #
Thanks, Marc. A new snapshot is online. Christian
Quoted text · Marc van Grootel · 50 lines
On Sun, Nov 16, 2014 at 12:56 PM, Marc van Grootel <marc.van.grootel at gmail.com> wrote: > ... even weirder, it returns li/@id=last three times > > --Marc > > On Sun, Nov 16, 2014 at 12:51 PM, Marc van Grootel > <marc.van.grootel at gmail.com> wrote: >> Hi, >> >> I think I bumped into a bug (on 8.0 snapshot) >> >> let $input := >> <ul> >> <li id="first">item 1</li> >> <li>item 2</li> >> <li id="last">item 3</li> >> </ul> >> >> return >> outermost(( >> $input//li[@id = 'last'], >> $input//li, >> $input//li[@id = 'first'] >> )) >> >> => >> >> <li id="first">item 1</li> >> <li>item 2</li> >> <li id="last">item 3</li> >> <li id="last">item 3</li> >> <li id="last">item 3</li> >> >> This is in document order but duplicates are not eliminated. The same >> happens with fn:innermost. >> >> According to the spec[1] "takes as input a sequence of nodes, and >> returns every node within the sequence that does not have another node >> within the sequence as an ancestor; the nodes are returned in document >> order with duplicates eliminated." >> >> [1] http://www.w3.org/TR/xpath-functions-30/#func-outermost >> >> --Marc > > > > -- > --Marc
MG
Marc van Grootel16 Nov 2014 14:12 #
Verified fixed. Thanks. Didn't expect a fix on Sunday though ;-) --Marc
Quoted text · Christian Grün · 56 lines
On Sun, Nov 16, 2014 at 1:57 PM, Christian Grün <christian.gruen at gmail.com> wrote: > Thanks, Marc. A new snapshot is online. > Christian > > > On Sun, Nov 16, 2014 at 12:56 PM, Marc van Grootel > <marc.van.grootel at gmail.com> wrote: >> ... even weirder, it returns li/@id=last three times >> >> --Marc >> >> On Sun, Nov 16, 2014 at 12:51 PM, Marc van Grootel >> <marc.van.grootel at gmail.com> wrote: >>> Hi, >>> >>> I think I bumped into a bug (on 8.0 snapshot) >>> >>> let $input := >>> <ul> >>> <li id="first">item 1</li> >>> <li>item 2</li> >>> <li id="last">item 3</li> >>> </ul> >>> >>> return >>> outermost(( >>> $input//li[@id = 'last'], >>> $input//li, >>> $input//li[@id = 'first'] >>> )) >>> >>> => >>> >>> <li id="first">item 1</li> >>> <li>item 2</li> >>> <li id="last">item 3</li> >>> <li id="last">item 3</li> >>> <li id="last">item 3</li> >>> >>> This is in document order but duplicates are not eliminated. The same >>> happens with fn:innermost. >>> >>> According to the spec[1] "takes as input a sequence of nodes, and >>> returns every node within the sequence that does not have another node >>> within the sequence as an ancestor; the nodes are returned in document >>> order with duplicates eliminated." >>> >>> [1] http://www.w3.org/TR/xpath-functions-30/#func-outermost >>> >>> --Marc >> >> >> >> -- >> --Marc
-- --Marc

⚡Generated with XQuery