benibela / internettools

XPath/XQuery 3.1 interpreter for Pascal with compatibility modes for XPath 2.0/XQuery 1.0/3.0, custom and JSONiq extensions, pattern matching, XML/HTML/JSON parsers and classes for HTTP/S requests
http://www.benibela.de/sources_en.html#internettools
122 stars 35 forks source link

Xpath 3.1 update #18

Closed thierrydev closed 5 years ago

thierrydev commented 5 years ago

Hello I use this tool to learn xpath and python web scraping and I was wondering how much effort is required to update this to Xpath 3.1 please

benibela commented 5 years ago

Here are the 3.1. test results: xpath31.txt xquery31.txt

The biggest issue is the map data type. It requires a complete redesign/rewrite of the current JSONiq based map type, because currently it only supports strings as keys, while in 3.1 it should allow keys of any type, e.g. numbers and datetimes. And it is too slow

And for arrays there is the issue that [(1, 2)] has been evaluated as [1,2] in JSONiq, but becomes [[1,2]] in XPath 3.1 (when serializing). That somehow needs to be changed without breaking everyone's code using the old syntax

thierrydev commented 5 years ago

I see thank you for the quick reply - the web tool is very useful.