Page 1 of 1
XSLT text value template within CDATA
Posted: Fri May 02, 2025 6:32 pm
by pgfearo
In the Oxygen XSLT editor, there is no syntax-highlighting or other XPath related features for XPath within text-value-templates - when they are embedded within a CDATA section. This looks like a bug.
Re: XSLT text value template within CDATA
Posted: Thu May 08, 2025 1:44 pm
by pgfearo
There's been no response to this bug report yet. Are you able to reproduce the issue, do you need sample XSLT?
Re: XSLT text value template within CDATA
Posted: Thu May 08, 2025 4:12 pm
by Mircea
Hello,
A small sample will be very helpful,
Thanks,
Mircea
Re: XSLT text value template within CDATA
Posted: Fri May 09, 2025 11:23 am
by pgfearo
Here's a screenshot of Oxygen 27.0 with XSLT including a text-value-template nested within a CDATA section:
Screenshot 2025-05-09 at 09.07.07.png
Oxygen correctly reports an error with the '$nx' variable reference in the XPath expression within the first text-value-template. Confirming that an attempt is being made to evaluate this. However, the XPath expressions have no syntax highlighting. I expect to see the expressions within the {} curly braces of the text-value-templates on lines 15 and 16 in the screenshot (repeated below) with XPath syntax highlighting. But the expressions are just coloured green.
Code: Select all
<this is in CDATA> {for $n in 1 to $max return $nx || ','}
<and this is also> {225 + $max}
Re: XSLT text value template within CDATA
Posted: Mon May 12, 2025 1:08 pm
by teo
Hello,
Thanks for posting the screenshot.
Yes, parsing of CDATA sections is done correctly in Oxygen, but we do not provide syntax highlighting or content completion support for them.
I will log a task to further investigate how we can improve the reported situation.
But the problem is not limited to XPath expressions in CDATA, other types of content can be embedded in CDATA sections and should be considered and handled accordingly.
Regards,
Teo
Re: XSLT text value template within CDATA
Posted: Mon May 12, 2025 4:33 pm
by pgfearo
But the problem is not limited to XPath expressions in CDATA, other types of content can be embedded in CDATA sections and should be considered and handled accordingly.
CDATA sections are not parsed by the XML parser, but they are parsed by the XSLT processor, because of 'text-value-templates'. So, as far as I know, no other types of content within a CDATA section, apart from 'text-value-templates' containing XPath expressions, should have syntax-highlighting in the XSLT editor. Everything else, even if it appears to have XML-like syntax, is just text and should therefore need no special auto-completion or highlighting.
I'd expect the syntax-highlighting to resemble something close to this:
tvt-within-cdata-oxygen.png
Is this your understanding also?
Re: XSLT text value template within CDATA
Posted: Mon May 12, 2025 5:07 pm
by teo
My comment was referring to XML content type in a broader sense. But of course, restricting the analysis to XSLT, you are probably right.
Anyway, as I already mentioned, we are going to delve deeper into the problem.
And, of course, we will update this topic, if we decide on an improvement related to this aspect.