XML Format in Console

xmllint is a command line xml tool in console to parse one or more xml files. It also can print type of output by the options selected and detect erros both in XML code.

But I mainly used it to format XML format, by using aliases, it can save a lot of time when doing XML format task.

alias xmlformat="xmllint --c14n '$*' | XMLLINT_INDENT=$'  ' xmllint --encode UTF-8 --format -"

No comments:

Post a Comment