Sunday, April 26, 2009

Using tidy to Format XML

Here's an exmaple of using tidy to format XML:
tidy -utf8 -xml -w 255 -i -c -q -asxml
I like to use an alias to work with files easily:
$ alias xmltidy="tidy -utf8 -xml -w 255 -i -c -q -asxml"

$ xmltidy some-file.xml > tidy-file.xml
You can also change a file in place:
$ xmltidy -m some-file.xml

No comments:

Post a Comment