Page 1 of 1

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

Posted: Thu Apr 06, 2017 1:00 pm
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.

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

Posted: Mon Apr 10, 2017 6:43 pm
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

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

Posted: Tue Oct 03, 2017 10:21 am
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

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

Posted: Tue Jan 09, 2018 10:58 pm
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.

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

Posted: Wed Jan 10, 2018 12:15 pm
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