tags:

views:

64

answers:

2

I am trying to read some logs through a Linux terminal which contain some XML, (the entire log is not XML, but some of it's contents is). Is there any text editors, add-ons or scripts which will attempt to format the the contents that is XML to make it easier to read. I dont need it to save the new formatting, just display it for easy reading.

Thanks!

A: 

you could try something like this pretty print script for vim: http://www.vim.org/scripts/script.php?script_id=2130

UberAlex
+2  A: 

In vim, you can filter [parts of] your file through any external command. In this case you can try xmllint --format.

scrible
This works. I've had this mapping for ages :nnoremap <leader>xb :%!xmllint --format -<cr> . it could just as easily be an autocommand
michael
This is close to what I am looking for, the XML is inside some of the log entries, each line in the log starts with a time stamp. So xmllint always chokes on the first line because it expects a '<'...
FireWire