Is there a way to enable XPath content completion in text templates in XSLT 3.0?

Here should go questions about transforming XML with XSLT and FOP.
Martin Honnen
Posts: 96
Joined: Tue Aug 19, 2014 12:04 pm

Is there a way to enable XPath content completion in text templates in XSLT 3.0?

Post by Martin Honnen »

One of the new features in XSLT 3.0 is text value templates https://www.w3.org/TR/xslt-30/#text-value-templates, I had hoped to be able to use them in oXygen 19 with Saxon EE/PE and XSLT 3.0 support, I don't get any syntax errors using them but it seems there is no XPath variable/function content completion inside curly braces, as there is for attribute value templates. Is there any way to enable that for text value templates? If not, is that a feature planned for the future?

Sample code is e.g.

Code: Select all

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:math="http://www.w3.org/2005/xpath-functions/math"
exclude-result-prefixes="xs math"
expand-text="yes"
version="3.0">

<xsl:param name="seq" as="xs:string*" select="'c', 'a', 'b', 'z'"/>

<xsl:template name="main">
{sort($seq)}
</xsl:template>

</xsl:stylesheet>
with the expand-text I would like to see XPath variable/function content completion inside the curly braces of the

Code: Select all


{sort($seq)}
text value template.
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Is there a way to enable XPath content completion in text templates in XSLT 3.0?

Post by adrian »

Hi,

"Text Value Templates" are not yet supported in oXygen v19.0.
An issue is already logged to implement this support. I've added your vote. For tracking reference it is issue EXM-30486.
We will notify this thread when it is implemented.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
tavy
Posts: 365
Joined: Thu Jul 01, 2004 12:29 pm

Re: Is there a way to enable XPath content completion in text templates in XSLT 3.0?

Post by tavy »

Hello.

We released Oxygen XML Editor 19.1 a couple of days ago and we added support for XSLT 3.0 text value templates.

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
Martin Honnen
Posts: 96
Joined: Tue Aug 19, 2014 12:04 pm

Re: Is there a way to enable XPath content completion in text templates in XSLT 3.0?

Post by Martin Honnen »

Should I now get variable/function name completion in text value templates? I have tried with oXygen XML Editor 19.1, build 2017121318, but it doesn't seem to be implemented, for instance when I use an XSLT 3 stylesheet with expand-text="yes" on the root element and create a literal result element with e.g.

Code: Select all


<test2>{sort($)}</test2>
and the cursor behind the dollar sign and type Ctrl-Space to get variable completion suggestions nothing happens.

Not even the syntax coloring is consistent,in a file like

Code: Select all


?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:math="http://www.w3.org/2005/xpath-functions/math"
exclude-result-prefixes="xs math"
expand-text="yes"
version="3.0">

<xsl:variable name="names" as="xs:string*" select="'foo', 'bar', 'baz'"/>
<xsl:param name="seq" as="xs:string*" select="'c', 'a', 'b', 'z'"/>

<xsl:template match="/">
<root>
<test>{$names}</test>
<test2>{sort($seq)}</test2>
<test3><xsl:value-of select="sort($names)"/></test3>
<test4>{sort($names)}</test4>
</root>
</xsl:template>

</xsl:stylesheet>
only the first two text templates are colored, the last one inside of the test4 element is in plain black text.
tavy
Posts: 365
Joined: Thu Jul 01, 2004 12:29 pm

Re: Is there a way to enable XPath content completion in text templates in XSLT 3.0?

Post by tavy »

Hello,

Thank you for your feedback.
The content completion in text value templates works only for variables and parameters. We have an issue on our issue tracker to implement also XPath content completion in text value templates. This is scheduled for the next oXygen version. We will update this thread when this will be implemented.

For the syntax highlight problem I added an issue on our issue tracker. It seems that when you have multiple elements with text value templates the syntax highlight and content completion does not work.

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
tavy
Posts: 365
Joined: Thu Jul 01, 2004 12:29 pm

Re: Is there a way to enable XPath content completion in text templates in XSLT 3.0?

Post by tavy »

Hello,

We just released <oXygen/> XML editor version 20.
Please note that we added full content completion support for text value templates. XPath functions, axes, and parameters/variables from the context are now proposed in the content completion list. See full release notes: https://www.oxygenxml.com/xml_editor/wh ... provements

We solved also the syntax highlight problem that you reported for text value templates.

You can download the build from here:
https://www.oxygenxml.com/xml_editor/do ... ditor.html

Thanks again for your feedback.

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
dsewell
Posts: 125
Joined: Mon Jun 09, 2003 6:02 pm
Location: Charlottesville, Virginia USA

Re: Is there a way to enable XPath content completion in text templates in XSLT 3.0?

Post by dsewell »

I just discovered that this content completion is working when I was testing the use of @expand-text="true" for the first time, using oXygen 20.1. Thanks to the oXygen team for being so thorough in adding UI features that keep up with the changes in XPath/XSLT specifications!
Post Reply