Project

Profile

Help

Bug #2604

closed

Incorrect location for XQuery error

Added by Alin Balasa about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2016-01-27
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
9.7
Fix Committed on Branch:
9.7
Fixed in Maintenance Release:
Platforms:

Description

The latest Saxon 9.7 reports errors with invalid location when compiling/executing XQuery files.

For the following sample:

<results>
    {
        let $a := doc("bib.xml")//author
        let $b := position($a)
        for $last in distinct-values($a/last),
            $first in distinct-values($a[last = $last]/first)
        order by $last,
            $first
        return
            <result>
            </result>
    }
</results>

the latest Saxon distribution reports the next error:

Static error on line 5 at column 21 of file:/D:/workspace_development_branch/eXml-branch-development/test.xquerynear {... := position($a) for $}
  XPST0017: System function position() cannot be called with one argument
Static error(s) in query

Running the same XQuery with Saxon 9.6 will produce the expected result:

Error on line 4 column 19 of test.xquery:
  XPST0017 XQuery static error near #... := position($a) for $#:
    System function position() cannot be called with one argument
Static error(s) in query

I used the next command line to run the XQuery file:

java -cp lib\saxon9ee.jar net.sf.saxon.Query -q:test.xquery
Actions #1

Updated by Michael Kay about 8 years ago

  • Status changed from New to Duplicate
  • Priority changed from Low to Normal

Thanks for reporting it, but this appears to be a duplicate of Bug 2575.

Actions #2

Updated by Alin Balasa about 8 years ago

Michael Kay wrote:

Thanks for reporting it, but this appears to be a duplicate of Bug 2575.

I have tested with the latest Saxon 9.7.0.2 maintenance build available on the website. I have browsed the SVN history and it seems

that the revisions associated with the Bug 2575 should be already included in the Saxon 9.7.0.2 maintenance build.

Is it something that I missed?

Actions #3

Updated by Michael Kay about 8 years ago

  • Status changed from Duplicate to In Progress
Actions #4

Updated by O'Neil Delpratt about 8 years ago

  • Status changed from In Progress to Resolved
  • Found in version deleted (9.7.0.2)
  • Applies to branch 9.7 added
  • Fix Committed on Branch 9.7 added

We have made some further refinement in this area and committed to subversion.

We have also fixed a related line number bug sent from Oxygenxml which was reporting line number -2 in the following code:

...
 public static void main(String[] args) {
     try {
       XpathPerformer.compileQueryWithS9API("//personal&");

     } catch (net.sf.saxon.trans.XPathException e) {
       SourceLocator locator = e.getLocator();
     System.out.println("Line: " + locator.getLineNumber());
     System.out.println("Column: " + locator.getColumnNumber());
     } 
...
Actions #5

Updated by O'Neil Delpratt about 8 years ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 9.7.0.3 added

Bug fix applied in the Saxon 9.7.0.3 maintenance release.

Please register to edit this issue

Also available in: Atom PDF