sudo yum install source-highlight
source-highlight --lang-list | less
xmllint: 標準的に入っており、整形はしてくれるが色は付かない
sudo yum install libxml2
# ファイルを整形して表示 xmllint --format results/results.xml # source-highlightで色づけして表示 xmllint --format results/results.xml | source-highlight -f esc -s xml # stdoutから整形して表示 echo '<root><foo a="b">example</foo><bar value="ipsum" /></root>' | xmllint --format - <?xml version="1.0"?> <root> <foo a="b">example</foo> <bar value="ipsum"/> </root> # curlのstdoutをxmllintで整形して表示 curl -sL http://www.ekidata.jp/api/s/1130224.xml | xmllint --format - <?xml version="1.0" encoding="UTF-8"?> <ekidata version="ekidata.jp station api 1.0"> <station> <pref_cd>13</pref_cd> <line_cd>11302</line_cd> <line_name>JR山手線</line_name> <station_cd>1130224</station_cd> <station_g_cd>1130101</station_g_cd> <station_name>東京</station_name> <lon>139.766103</lon> <lat>35.681391</lat> </station> </ekidata>