Here’s a factual question: What XML editor would you recommend?
vi
No, I’m not joking, even if it seems that way.
But I’m a sick sick man. Being a sysadmin is something you never really recover from.
Let me ask the logical counter-question. What platform or operating system? That affects what’s available.
Reported for move to IMHO.
I would use vi, but I’m forced to be on Windows so I’m hoping for an editor that will at least format the XML in a useful fashion.
Notepad ++
I use XML Notepad, mainly for the schema validation, but I am not really creating the XML there, I’m just validating and tweaking output from one of my programs.
Atom editor: https://atom.io/
What is the use case of the XML?
You can edit XML in any ascii text editor. It is however painful. Despite appearances, XML is not really useful for humans to edit directly. A few lines, sure, and maybe modify a tiny snippet to fix a problem or execute a hack. For that anything from vi up. Emacs would be my choice, but I have been known to patch XML with vi.
But for anything serious you want XML aware tools. Emacs will get you a minimal set. After that you really want to be thinking about the actual XML schema you are using, and what you are doing with it. Generating XML from scratch is not a job for human beings. Personally I tend to use Python and the PyXML library. YMMV.
Moderator Action
Listing free editors would be factual enough, but recommendations tend to involve opinions. Let’s move this to IMHO so that folks can give their opinions on different editors as well.
Moving thread from GQ to IMHO.
I second this suggestion.
On virtually any platform, the Eclipse platform has a pretty good XML editor built in. It’s an IDE, mostly (but not entirely) focused on Java, but it’s pretty good for any type of code.
On the Mac, BBEdit is the gold-standard text editor. It has a full-featured 30-day trial, after which the paid features become unavailable, but the free features are still pretty damn good.
Also on any platform, you could use emacs. Who doesn’t love emacs? Soooooo cuddly.
It depends on what you want to do with the file.
I use different editors depending on whether I want to…
Run macros
Edit element values
Search/replace - copy/paste
Validate against an XSD
There’s no need to be restricted to a single tool.
But Notepad++ is a good place to start.
If you don’t already know vi… probably don’t start there.
Notepad++ has a vi simulator plugin, by the way…so you can have the best of both worlds!