[REQ] XML editor

  • Thread starter Thread starter Peter Gordon
  • Start date Start date
P

Peter Gordon

I have XML files which consist of only one
very long line. I require an editor which
will reformat them.
Exchanger XML lite does it, but:
1. It is nagware
2. It is written in Java and is very slow
loading.

Thanks,

Peter Gordon
 
I have XML files which consist of only one very long line.

Sounds like Unix line breaks. Try to open the files with Notepad++:

http://notepad-plus.sourceforge.net

As has been mentioned a few posts earlier, a new version (v3.5) is
available. So access to the homepage may be somewhat slow for the
next hours.

Notepad++ supports syntax coloring and folding for *.xml. And you
can easily convert Unix to PC formatting via <Format> menu.

BeAr
 
Sounds like Unix line breaks. Try to open the files with Notepad++:

http://notepad-plus.sourceforge.net

BeAr

Nope, I have two text editors which support Unix line breaks
and it displays as one line in these.

In Exchanger XML Lite, it initially displays as one line
but the program has what is calls a "Reformat" which
displays it well with all indents correct.

I have seen many Postscript files formatted as one line.
This makes them easy to parse by machine but sheer hell
to hand edit. This is a similar problem with XML. If
I can't find an acceptable program to do the job, I'll
write something quick & dirty to do it. I should not
be too hard. (Famous last words <g>)
 
I have XML files which consist of only one
very long line. I require an editor which
will reformat them.

You can do this using the free XML Notepad from Microsoft.

That is, if you can find it. The link used to be
http://msdn.microsoft.com/xml/notepad/download.asp, but that no longer
works.

Hmm, looks like you can get it here:
http://www.devhood.com/Tools/tool_details.aspx?tool_id=261.

XML Notepad will display the file as a tree structure, but I when you
save the file, it will put the line-ends in, as well as indent the
lines based on the structure.

Terry
 
You can do this using the free XML Notepad from Microsoft.

That is, if you can find it. The link used to be
http://msdn.microsoft.com/xml/notepad/download.asp, but that no longer
works.

Hmm, looks like you can get it here:
http://www.devhood.com/Tools/tool_details.aspx?tool_id=261.

XML Notepad will display the file as a tree structure, but I when you
save the file, it will put the line-ends in, as well as indent the
lines based on the structure.

Terry

Thanks Terry,
I downloaded it and it does exactly what I want.

Peter Gordon
 
Sounds like Unix line breaks. Try to open the files with Notepad++:
[...]
Nope, I have two text editors which support Unix line breaks
and it displays as one line in these.

Although you already have a working solution, Notepad++ could still be
the better program for your needs. The TextFX plugin for Notepad++
provides (among many other useful functionality) direct access to the
libtidy.dll, which is a flavor of HtmlTidy.

This plugin is part of the precompiled distribution while libtidy.dll
and libtidy.ini are not. You can get these files by also downloading
the separate TextFX plugin package from the Notepad++ download page.

The libtidy.ini doesn't contain a section (= function) suitable to
your reformatting needs, yet. So you need to add something like this:

[Clean XML files]
input-xml:yes
add-xml-space:yes
indent:yes
indent-attributes:yes
vertical-space:yes
wrap-attributes:yes
wrap-sections:yes
force-output:yes
write-back:yes

After a restart of Notepad++ (or a refresh of the [TextFX Html Tidy]
Plugins menu) you can select [Clean XML files] to insert the line
breaks and do some further formatting.

A reference for the supported functions of libtidy.dll can be found
here:

http://tidy.sourceforge.net/docs/quickref.html

And just another thought: You should also get the separate XMLCheck
plugin. (That's not part of the main Notepad++ package.) It does a
good job of syntax checking.

BeAr
 
Although you already have a working solution, Notepad++ could still be
the better program for your needs. The TextFX plugin for Notepad++
provides (among many other useful functionality) direct access to the
libtidy.dll, which is a flavor of HtmlTidy.


A reference for the supported functions of libtidy.dll can be found
here:

http://tidy.sourceforge.net/docs/quickref.html

And just another thought: You should also get the separate XMLCheck
plugin. (That's not part of the main Notepad++ package.) It does a
good job of syntax checking.

BeAr

Thanks, I have downloaded it. There appears to be a fair
learning curve. I will give it a try.

Peter Gordon
 
On Mon, 6 Mar 2006 19:57:26 +0000 (UTC), Peter Gordon wrote:

[Notepad++ and libtidy.dll for XML formatting]
Thanks, I have downloaded it. There appears to be a fair
learning curve. I will give it a try.

And just a note in case you already have another favorite editor which
has the ability to run external tools. (Ahem.) ;-)

There is also a free command line version of Tidy for Windows available,
that supports the same functionality as libtidy.dll:

http://dev.int64.org/tidy.html

HTH, too.
BeAr
 
On Mon, 6 Mar 2006 19:57:26 +0000 (UTC), Peter Gordon wrote:


There is also a free command line version of Tidy for Windows available,
that supports the same functionality as libtidy.dll:

http://dev.int64.org/tidy.html

HTH, too.
BeAr
Now that is fiendish! <g>
I got it to work using a config file, but get lots
of warnings. I'll stay with Notepad++ thanks.

Cheers,
 
Back
Top