Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node Comparison returns no data with nested predicate #5342

Open
adamretter opened this issue Jun 27, 2024 · 1 comment
Open

Node Comparison returns no data with nested predicate #5342

adamretter opened this issue Jun 27, 2024 · 1 comment
Labels
bug issue confirmed as bug

Comments

@adamretter
Copy link
Member

adamretter commented Jun 27, 2024

The data (example-1.xml) looks like:

<text>
  <lg>
      <w wid="_1_d2e15" id="d1e14" lemma="thalla">Thalla</w>
      <pc join="left">,</pc>
      <w wid="_1_d2e23" id="d1e20" lemma="voc">a</w>
      <w wid="_1_d2e26" id="d1e23" pos="nx" lemma="leabhar">leabhair</w>
      <w wid="_1_d2e30" id="d1e26" pos="a" lemma="beag">bhig</w>
      <w wid="_1_d2e33" id="d1e30" pos="px" lemma="neo">neo</w>
      <pc join="both">-</pc>
      <w wid="_1_d2e41" id="d1e36" pos="a" lemma="euchdach">euchdaich</w>
      <pc join="left">:</pc>
      <lb/>
      <w wid="_1_d2e50" id="d1e45" pos="V" lemma="amhairc">amhairc</w>
      <w wid="_1_d2e55" id="d1e54" pos="A" lemma="a-steach">a-steach</w>
      <w wid="_1_d2e58" id="d1e61" pos="p" lemma="an">’na</w>
      <w wid="_1_d2e61" id="d1e64" pos="ns" lemma="sùil">sùilean</w>
      <w wid="_1_d2e65" id="d1e67" pos="a" lemma="leugach">leugach</w>
      <pc join="left">:</pc>
      <lb/>
      <w wid="_1_d2e75" id="d1e76" pos="z" lemma="ge">ge</w>
      <w wid="_1_d2e78" id="d1e79" pos="a" lemma="bacach">bacach</w>
      <w wid="_1_d2e84" id="d1e82" pos="D" lemma="thu">thu</w>
      <pc join="left">,</pc>
      <w wid="_1_d2e90" id="d1e88" pos="z" lemma="cha">chan</w>
      <w wid="_1_d2e93" id="d1e92" pos="v" lemma="bi">eil</w>
  </lg>
</text>

The initial query setup looks like:

let $n := 7
let $word := doc("/db/meanma/example-1.xml")//w[@wid eq "_1_d2e50"]
let $following-n-words := $word/following-sibling::w[fn:position() le $n]

This expression returns no data:

$word/following-sibling::node()[. << $following-n-words[last()]]

Refactoring it to this (to remove the inner predicate), does return data:

let $last-following-n-word := $following-n-words[last()]
return
  $word/following-sibling::node()[. << $last-following-n-word]

Tested with eXist-db 7.0.0-SNAPSHOT (built from develop branch commit 097087b)

@adamretter adamretter added the bug issue confirmed as bug label Jun 27, 2024
@duncdrum
Copy link
Contributor

see #3459

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue confirmed as bug
Projects
None yet
Development

No branches or pull requests

2 participants