Tapatalk

XML Code folding with self-closing tags not working (fixed)

XML Code folding with self-closing tags not working (fixed)

4
NewbieNewbie
4

    Oct 17, 2011#1

    An issue I'm having with UE right now is how it handles code folding for XML documents when encountering self-closing tags. It appears to treat the final /> of the self-closing tag as the closing marker for the most recently opened 'standard' tag. Below is an example. Just paste it into a new document and set syntax highlighting to XML:

    Code: Select all

    <spellcast>
        <rules>
            <xi:include href="Include.xml" xpointer="//include[@name='AutoChangeGear']/*" />
            <xi:include href="Include.xml" xpointer="//include[@name='LevelRequirement']/*" />
            <xi:include href="Include.xml" xpointer="//include[@name='ReturnRules']/*" />
            
            <equip when="precast">
              <head>remove</head>
            </equip>
        </rules>
    </spellcast>
    Click on the opening 'rules' tag and it shows the closing tag as the /> of the AutoChangeGear line. Click on the 'spellcast' tag and it shows the /> of the LevelRequirement line as being the close. The 'spellcast' to 'LevelRequirement' segment is foldable; the 'rules' to 'AutoChangeGear' is not. The 'equip' tag set below that folds properly.

    Given the post about using single quotes in attributes, I tried removing the single quotes from the @name portion, but that didn't have any effect.

    Is there a change that could be made in the XML wordfile that would fix this, or is this a genuine bug? Or is there something else I'm missing?

    This is a recent problem, but I'm not sure if it first started with the update to 17.30 or not. While I've only rarely used the include tags until recently, I do not recall ever coming across this problem when they were present before. I re-downloaded the xml wordfile from the main site to be sure I had the latest version.


    Variant on the code sample:

    Code: Select all

    <spellcast>
        <rules>
            <xi:include href="Include.xml" xpointer="//include[@name='AutoChangeGear']/*" />
           
            <equip when="precast">
              <head>remove</head>
            </equip>
        </rules>
    </spellcast>
    Clicking on 'xi:include' shows that it recognizes that entire line as its own tag.
    Click on <rules> and it marks it as ending with the /> on the AutoChangeGear line (as in the first example).
    Click on <spellcast> open tag and it believes that it is closed with the </rules> tag, and folds accordingly.

    11
    Basic UserBasic User
    11

      Oct 26, 2011#2

      I pasted your example XML source into my UEStudio editor and it seems to be working ok for me. The "spellcast", "rules", and "equip" tags all have correct folding and vertical indent line indicators. It could be your XML syntax wordfile needs tweaking.

      4
      NewbieNewbie
      4

        Oct 27, 2011#3

        I checked against my computer at work, which has version 16.30 installed. Folding worked perfectly. Sent a copy of the wordfile home, and it's identical to the wordfile that was originally in my 17.30 install (before downloading the version from the website).

        However it's also easy to tell that there's been a change in how UE works with paired elements in XML/HTML files. In v16, UE only highlights pairs of angle brackets, so that you only see slight highlighting at the ends of a single tag. In v17, it highlights the matching half of the full tag (so <equip> matches with </equip>, rather than just the < of <equip> matching the > of <equip>).

        I'm not sure what codebase UEStudio is based on, but if it only highlights the angle brackets, that's the old pattern matching system. Folding worked, but it's not as 'nice' about matching tags.

        6,685587
        Grand MasterGrand Master
        6,685587

          Oct 27, 2011#4

          Highlighting matching XML/HTML/XHTML tags is controlled by configuration setting Display XML/HTML tag highlighting at Advanced - Configuration - Editor Display - Advanced which is a feature introduced with UE v17.00 and UES v11.00.

          Highlighting matching > for < is done by the brace matching feature controlled by Enable auto-brace matching at Advanced - Configuration - Editor Display - Brace Matching existing already in first version of UES and in UE since I use UE (v8.00).

          11
          Basic UserBasic User
          11

            Oct 27, 2011#5

            Thank you, Mofi. I need to review all the newer setup options that have come around in the last few versions. :)

              Nov 01, 2011#6

              OK...

              I just updated from UEStudio 11.10 to 11.20, which effectively picks up the most recent UE changes.

              After my update my XML syntax code folding now is broken as described by dsmith in his original post.

              If I choose to view my XML as HTML highlighting, then the code folding works ok. Seems as though something is indeed broken in the out-of-the-box version of XML syntax highlighting.

              I emailed IDM and attached a PDF document showing screen shots. I also mentioned this forum topic and provided a link to it so they could see that UE and UEStudio are both affected. Thanks for bringing this up dsmith.


              IDM has replied to my email:
              IDM wrote:Thank you for your message. We are aware of this issue, and this will be addressed in a forthcoming update soon.
              Looks like the fix will come soon, possibly in a hotfix. :)

              15
              Basic UserBasic User
              15

                Dec 13, 2011#7

                Well done Richard and dsmith!

                It is fixed in the hotfix build 17.30.0.1012 delivered TODAY :D

                JoernH

                2
                NewbieNewbie
                2

                  Jan 11, 2012#8

                  Even after installing the latest version of UE Studio 11.20.0.1006 today, I have the identical symptom as dsmith's original 2011-10-17 post. Was the hotfix 17.30.0.1012 applied only to UE but did not UES?

                  I also use UE3 16.20.0.1009 on my flash drive, and it highlights and folds XML self-closing tags correctly.

                  Mark Green
                  Anchorage, Alaska (USA)

                  11
                  Basic UserBasic User
                  11

                    Jan 11, 2012#9

                    spitvalve,

                    IDM just sent me a link to a fix (UEStudio version 11.20.0.1009) which fixes the problem. Send an email to [email protected] and ask them for that version as a fix for the XML code folding issue. They should reply with a download link for you.

                    2
                    NewbieNewbie
                    2

                      Jan 11, 2012#10

                      Richard:

                      Thank you for the heads-up! I sent an email and within minutes Troy sent me the 11.20.0.1009 update. I installed it and it works great.

                      -Mark Green dba spitvalve