XPath 3.0, simple mapping operator, and syntax highlighting
Posted: Tue May 20, 2014 7:03 pm
				
				If I connect (for example) a group of replace functions via the simple mapping operator, the syntax highlighting goes strange.
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.
			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’$2')
            !replace(.,'(\p{L})''(\p{L})','$1’$2')
            !replace(.,'''([^"'']+)''','‘$1’')
            !replace(.,'"([^"]+)"','“$1”')
            !replace(.,'"','“')
            !replace(.,'\p{Zs}*[‒–—]\p{Zs}*',' — ')
            !replace(.,'([\.\?!]_?)\p{Zs}+','$1 ')
            !replace(.,'\p{Zs}*\.\.\.\p{Zs}*','…')"
         />
    </xsl:function>
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.