Supporting content completion/tooltip helper for XPath 3.1 functions that take JSON map, like the transform function

Are you missing a feature? Request it's implementation here.
Martin Honnen
Posts: 43

Supporting content completion/tooltip helper for XPath 3.1 functions that take JSON map, like the transform function

Thu Sep 13, 2018 11:15 pm

With previous versions of XPath, oXygen has nice support for displaying argument types of a function call in XPath expressions in a tooltip (https://www.oxygenxml.com/doc/versions/ ... elper.html) but with the arrival of maps https://www.w3.org/TR/xpath-31/#id-maps in XPath 3.1 there are now functions (https://www.w3.org/TR/xpath-functions/#options) like the "transform" function https://www.w3.org/TR/xpath-functions/#func-transform that don't have a list of named arguments but rather expect a map with various, although predefined entries. Currently when you edit XPath or XQuery or use XSLT and use that function I don't get any autocompletion at all (in XML Editor 20.1, build 2018080903), not even for the function name (e.g. after typing "trans" and hitting Ctrl-Space I only see "translate" but not "transform") but I would hope you can also develop some way to list to the editor user the predefined map properties e.g. when I have typed

Code: Select all

transform(map {


I would like to get a tooltip and completion support for the predefined map keys of the expected map argument (e.g. 'stylesheet-node', 'source-node') as it is rather tedious memorizing them or having to work with the XPath function spec.

I understand it is kind of a challenge as the function signature doesn't declare the allowed options for a map but I hope for the predefined functions of XPath 3.1 that take maps as arguments you can build a list from the spec and that way assist the editor user in writing function calls with the right map entries.
adrian
Posts: 2459

Re: Supporting content completion/tooltip helper for XPath 3.1 functions that take JSON map, like the transform function

Tue Sep 18, 2018 7:11 pm

Hi,

In what context are you using XPath 3.1? Is it while editing XQuery (3.1) or is this in another context (e.g. XPath/XQuery Builder)?
It seems syntax highlight and format and indent have been improved for XQuery/XPath 3.1, but content completion has not yet been updated. I've logged a request on our issue tracking tool to address this.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Martin Honnen
Posts: 43

Re: Supporting content completion/tooltip helper for XPath 3.1 functions that take JSON map, like the transform function

Tue Sep 18, 2018 7:27 pm

adrian wrote:In what context are you using XPath 3.1? Is it while editing XQuery (3.1) or is this in another context (e.g. XPath/XQuery Builder)?


I use it inside XSLT 3 stylesheets as well as in XQuery 3.1 files, but often I try to experiment or prototype stuff in the XPath/XQuery builder (where I then select one of the Saxon 9.8 XQuery engines). So support in all three contexts (XSLT 3 editing, XQuery 3.1 editing, XPath/XQuery builder) would help, if that is not too greedy a request. My primary interest would be XPath 3.1 in XSLT 3, although in particular for the use of the "transform" function I am currently finding it easier to use XQuery 3.1 with dynamically generated XSLT as inside of XSLT I always need a namespace alias to create XSLT on the fly and then use the "transform" function.

Return to “Feature Request”

Who is online

Users browsing this forum: No registered users and 1 guest