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

XQuery: Bug on child node selection with count() #2193

Closed
Twilight-Shuxin opened this issue Mar 28, 2023 · 2 comments
Closed

XQuery: Bug on child node selection with count() #2193

Twilight-Shuxin opened this issue Mar 28, 2023 · 2 comments
Labels

Comments

@Twilight-Shuxin
Copy link

Description of the Problem

Given this XML document:

<A1 id="1">
    <B1 id="2">
        <C1 id="3">1</C1>
    </B1>
    <D1 id="4">2</D1>
</A1>

and XPath Query

//*[count(./*/*) >= 1]/*

BaseX give result

<B1 id="2">
        <C1 id="3">1</C1>
    </B1>

Expected Behavior

Should return both node 2 and 4 as Saxon & Exist db.

Steps to Reproduce the Behavior

  1. Create database create database test
  2. Insert XML file into database put test.xml path/to/file
  3. Execute XPath query //*[count(./*/*) >= 1]/*

Do you have an idea how to solve the issue?

No response

What is your configuration?

BaseX version: BaseX 10.6 beta latest commit 816b386 on Windows

@ChristianGruen
Copy link
Member

Good catch! It turns out the optimization introduced in #1864 is flawed and needs to be revised.

@Twilight-Shuxin
Copy link
Author

Thank you very much!

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

No branches or pull requests

2 participants