User to user discussion and support for UltraEdit, UEStudio, UltraCompare, and other IDM applications.

Help with setting up and configuring custom user tools in UltraEdit (based on command line input)
5 posts Page 1 of 1
Hi, can UltraEdit format XML document?

for example, <TAG1><SUB>HELLO</SUB></TAG1> would be

Code: Select all

I am the registered user of UltraEdit 9 and was wondering if there is a way to do above...

thanks in advance
You can use Tidy for formatting. I have following perl script asigned to tools, but guess you can also use bat or wsh :

Command line : perl -w C:\bin\ "%f"

#!perl -w
# Name:
# Use tidy to change input file and make bak
# Usage: xmlfile.xml

use strict;
use File::Copy;

die "No args...\n"
unless 0==$#ARGV;

my $xmlfile = shift;
die "Could not copy $xmlfile. $!\n"
unless copy($xmlfile, "$xmlfile.bak");

my @args = ('C:\\bin\\tidy.exe', '-m', '-xml', '-q', '-i', $xmlfile);
system(@args) == 0 or die "system @args failed: $?"

vel, thank you for the hint to Tidy. As a non Perl programmer I'm now using an Ultraedit Tool configuration with the Command Line:

cmd /c if /I "%E"==".XML" (E:\schlereth\tools\tidy\tidy-050522-exe\tidy.exe -m -xml -i "%F") else (echo NO XML File)

Command Output (DOS Commands) to List Box, Capture Output.
UltraEdit v17 does it (maybe previous releases too):
a) select the desired text,
b) in the main menu, select "Paragraph Formatting"+"ReIndent Selection", the result is here as the result of an XML beautifuller output

UltraEdit v17 le fait (peut être d'autres versions précédentes également):
a) sélectionner le texte désiré,
b) dans le menu principal, sélectionner "Formatage du paragraphe"+"Indenter de nouveau la sélection", le résultat est là, identique à la sortie d'un embellisseur XML
Wow, you really dug up an old post to respond to. The easiest way to handle the original post in the current version of UltraEdit is with the drop-down menu option:

Format -> XML Convert to CR/LFs
5 posts Page 1 of 1