Well, that you use an older version is a very important fact. Lots of XML related improvements have been implemented last year by IDM.
Your version supports already the
XMLlint Tool. The command to run it should be in the menu
Format also in your version of UltraEdit when you are using the default Advanced menu profile. And the tool should exist in the GNU subdirectory in the UltraEdit program directory.
But the XML Manager is only available with UE v15.10 and later. In the change history I found also for UE v12.20
b:
Fixed XML Convert to CR LF on very large files
And in hotfix information for v12.20b+1:
Fixed unclassified error running XMLLint
Fixed reindent format option with XMLLint
Fixed format output with XMLLint
So it is possible that this command is not working correct for your XML file in your version of UltraEdit. XMLlint support was introduced with UE v12.10 which explains why there are some bugfixes in the following versions of UltraEdit.
The commands
ReIndent Selection as well as
XML Convert to CR/LFs work only when the file is syntax highlighted with a syntax highlighting language containing the keyword
XML_LANG which is by default the case with default wordfile.txt of your version of UltraEdit.
Addition on 2011-06-03: With UE v17.10 and later the command XML Convert to CR/LFs is available for all files independent on highlighting of file with language containing keyword XML_LANG.
For testing I opened in UE v15.20.0.1022 an XML file. Because the XML file was already perfect indented, I deleted all leading whitespaces with an UltraEdit regular expression replace all command searching for
%[ ^t]+ and an empty replace string. Now I used first the command
XML Convert to CR/LFs and the result was perfect. I pressed Ctrl+Z to undo the reformatting (not possible in your version of UltraEdit) and used now
ReIndent Selection. Again the result was perfect.
I unpacked from my archives also UE v12.20+1 and v12.20b+1 and tried the same as above with v15.20.0.1022 on the same XML file. And indeed both commands failed in both 12.20 versions of UltraEdit to re-indent the lines in the XML file.
mattad wrote:Do I really have to upgrade?
When you work in future more than up to now with XML files, you should think about it.
But I found a workaround which worked with both UE v12.20. Selecting at
View - View As (Highlighting File Type) instead of
XML the language
HTML, then selecting all with Ctrl+A and using
ReIndent Selection worked for my example XML file. So I thought that maybe copying the lines
/Indent Strings = "<"
/Unindent Strings = "</"
from the HTML syntax highlighting language in wordfile.txt to language
/L6"XML" could be helpful to get the command
ReIndent Selection to work for XML files as well. Indeed with those 2 lines inserted above the line
/C1"Elements" STYLE_ELEMENT
in wordfile.txt for language
/L6"XML" helped and
ReIndent Selection worked. Interesting is that default wordfile for XML in UE v15.20.0.1022 still does not contain the 2 indent/unindent strings definition lines. So IDM has really improved built-in support for XML files in later versions of UltraEdit.
Ah, one more thing. I have seen XML files with leading non breaking spaces. A non breaking space has byte code 160 (0x80). Non breaking spaces are not interpreted as whitespaces. If you enable
View - Show Spaces/Tabs and see still spaces instead of dots at start of some lines, your XML file also contains non breaking spaces. Select one of them and press Ctrl+R to open the replace dialog. The search edit field contains now already the non breaking space character. So you only have to enter a normal space in the replace edit field and press button Replace All to replace all non breaking spaces by normal spaces.