Skip to content

XQuery: Unexpected exception of arithemetic operations with positional expression #2224

@Twilight-Shuxin

Description

@Twilight-Shuxin

Description of the Problem

Given this XML document:

<X/>

and XPath Query

//X[not(position() * 2 = last())]

BaseX gives unexpected exception

[XPTY0004] Cannot convert xs:decimal to xs:integer: 0.5.

Result is similar for query

//X[not(position() + position() = last())]

Expected Behavior

Should be able to execute successfully.

Steps to Reproduce the Behavior

  1. Create database create database test <X/>
  2. Execute XPath query xquery //X[not(position() * 2 = last())]

Do you have an idea how to solve the issue?

No response

What is your configuration?

BaseX version: BaseX 10.7 beta latest commit abf2eca on Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions