Sunday 4 April 2010

Flatten XML files with the XML Flattener

Have you ever needed to “flatten” a pretty-printed XML file for pasting into a web service test page? XmlSpy and the like will happily display ugly XML in a nicely-indented format but the version I have doesn’t un-pretty-print (or flatten) XML for me.

Custom tool to the rescue! Announcing my very first codeplex project and the XML Flattener!

This first alpha release is a simple WinForms apps with zero error handling and very limited capabilities allowing you paste in an XML document, flatten it, and copy out the flattened string. The hard work is accomplished by—wait for it—leveraging the default formatting of the XmlDocument’s OuterXml property (which isn’t formatted, unlike other XML-related classes which do return formatted documents).

XML FlattenerFYI I built this app years ago when I was doing a lot of web service integration work so it’s a fairly naive tool built primarily for testing web services. It’s original title was The XML Bastardiser but I’ve attempted to make the name a bit more relevant with this first public release ;-)

Enjoy!

No comments:

Post a Comment

Spam comments will be deleted

Note: only a member of this blog may post a comment.