XPath 3.0, simple mapping operator, and syntax highlighting

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Graydon2014
Posts: 15
Joined: Tue May 20, 2014 6:55 pm

XPath 3.0, simple mapping operator, and syntax highlighting

Post by Graydon2014 »

If I connect (for example) a group of replace functions via the simple mapping operator, the syntax highlighting goes strange.

Code: Select all


<xsl:function as="xs:string" name="d:charReplace">
<xsl:param name="inString" as="xs:string" />
<xsl:sequence
select="replace($inString,'(\p{L}s)''(\p{Zs})','$1&#x2019;$2')
!replace(.,'(\p{L})''(\p{L})','$1&#x2019;$2')
!replace(.,'''([^"'']+)''','&#x2018;$1&#x2019;')
!replace(.,'"([^"]+)"','&#x201C;$1&#x201D;')
!replace(.,'"','&#x201C;')
!replace(.,'\p{Zs}*[&#x2012;&#x2013;&#x2014;]\p{Zs}*','&#x00A0;&#x2014;&#x00A0;')
!replace(.,'([\.\?!]_?)\p{Zs}+','$1&#x0020;')
!replace(.,'\p{Zs}*\.\.\.\p{Zs}*','&#x2026;')"
/>
</xsl:function>
The first replace gets correct syntax highlighting; the second replace gets highlighted in attribute-value-brown, has the L character highlighted as though it were an element name, and things continue peculiar from there.

I was hoping 16.0 would fix this; there's a general issues with the highlighting going funny with long XPath expression, which might or might not be related to line breaks.
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: XPath 3.0, simple mapping operator, and syntax highlight

Post by adrian »

Hi,

We were not aware of this particular problem.
I can confirm that this problem is triggered by the line breaks from the XPath expression.

I have logged this to our issue tracking tool. This will be analyzed and resolved in a future version of Oxygen.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Graydon2014
Posts: 15
Joined: Tue May 20, 2014 6:55 pm

Re: XPath 3.0, simple mapping operator, and syntax highlight

Post by Graydon2014 »

adrian wrote:I have logged this to our issue tracking tool. This will be analyzed and resolved in a future version of Oxygen.
Thank you!

It would be good if the format-and-indent was aware of line breaks in long XPath expressions in attributes, too; a coding team has to be very careful about all having the exact same settings to avoid messing those up into illegibility.
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: XPath 3.0, simple mapping operator, and syntax highlight

Post by adrian »

Hi,

I tested but could not identify a format and indent problem for attributes with the default formatting options.
By default Oxygen preserves line breaks in attributes (Preferences, Editor > Format > XML ,'Preserve line breaks in attributes'), so it won't affect the line breaks from long XPath expressions that span across multiple lines.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply