Folding sometimes not available

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
awagner
Posts: 4
Joined: Thu May 15, 2014 1:51 pm

Folding sometimes not available

Post by awagner » Wed Oct 21, 2020 4:54 pm

Dear all,

why would there be occasions when oxygen seems not to recognize where it could fold my code?

I have a long xslt stylesheet where no folding triangle buttons are available in the gutter. When I delete everything except the following, it still does not work:

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:tei="http://www.tei-c.org/ns/1.0"
    xmlns="http://www.tei-c.org/ns/1.0"
    exclude-result-prefixes="xs"
    version="2.0">

    <xsl:variable name="identifiedAbbr">
        <xsl:apply-templates select="/" mode="identify-abbr"/>
        <xsl:message select="'INFO: identified abbreviations.'"/>
    </xsl:variable>

    <!-- identity transform -->
    <xsl:template match="@*|node()" mode="identify-abbr">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()" mode="identify-abbr"/>
        </xsl:copy>
    </xsl:template>

</xsl:stylesheet>
When I add this same code to a new document, it is possible to fold. But I am reluctant to post the full stylesheet. There must be something in it tripping up oxygen's folding logic...

The code seems well-formed, the lines in the gutter indicating the extent of the currently focused element are working, and in oxygen for linux, the very same code can be folded. In oxygen for windows, however, it cannot. I have folding enabled in the settings and in fact, in the next tab, there is an xml file that folds nicely...

So I guess my question is: What factors can influence folding?

Best,
Andreas

adrian
Posts: 2701
Joined: Tue May 17, 2005 4:01 pm

Re: Folding sometimes not available

Post by adrian » Mon Oct 26, 2020 2:03 pm

Hello,

What version and build of Oxygen are you using (Help > About)?
awagner wrote:
Wed Oct 21, 2020 4:54 pm
So I guess my question is: What factors can influence folding?
If the syntax highlight breaks, folding can sometimes also fail. So, if you see tags, attributes, or text colored in red (or otherwise having the incorrect color for the respective XML token), the syntax highlight has failed. If that's the case, it should also provide some clue of what piece of code is making it fail as that portion should be incorrectly highlighted.

Folding can also be disabled completely for documents requiring Special Character Support. It's less likely to encounter this for an XSLT document, but you may have a stray Unicode character that triggers this. Look in the Properties view (Window > Show view > ...) for the BIDI property. If it's set to true, that is the cause.
To control this, go to Options > Preferences, Editor > Open and set "Support for Special Characters" to "Prompt for each document", close and reopen your document. Pick Disable when asked about the support for special characters.

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

awagner
Posts: 4
Joined: Thu May 15, 2014 1:51 pm

Re: Folding sometimes not available

Post by awagner » Tue Oct 27, 2020 6:01 pm

adrian wrote:
Mon Oct 26, 2020 2:03 pm
you may have a stray Unicode character that triggers this. Look in the Properties view (Window > Show view > ...) for the BIDI property. If it's set to true, that is the cause.
To control this, go to Options > Preferences, Editor > Open and set "Support for Special Characters" to "Prompt for each document", close and reopen your document. Pick Disable when asked about the support for special characters.
Seems that is the culprit: The BIDI property is true on both platforms, but on my linux box I had support disabled already and on windows I did not (yet). Now I have disabled support for special characters also on windows and that fixed it.

Thank you!!

Best,
Andreas

For completeness' sake:
adrian wrote:
Mon Oct 26, 2020 2:03 pm
What version and build of Oxygen are you using (Help > About)?
On windows it's XML Editor 22.1, build 2020100710, on linux it's XML Editor 22.0 build 2020030607

Post Reply