1

xmllint fileName - checks if the xml defined is right..

Is there any command to indent xml from terminal?

2
  • 2
    stackoverflow.com/questions/16090869/… Commented Dec 16, 2014 at 5:34
  • xmllint --format filename "prints" the indented output. Is there any command to indent an xmlfile ?In eclipse CTRL+I indents any given piece of code..Similarly is there any command available? Commented Dec 16, 2014 at 5:40

1 Answer 1

5

xmllint does have a --format option:

--format
       Reformat and reindent the output. The XMLLINT_INDENT environment
       variable controls the indentation. The default value is two spaces
       " ").
Sign up to request clarification or add additional context in comments.

1 Comment

I just found an answer in wiki of vim .Hope this may be useful. Open vimrc file -> au FileType xml exe ":silent %!xmllint --format --recover - 2>/dev/null" ... ! Insert this in autocmd section. Refer vim.wikia.com/wiki/Format_your_xml_document_using_xmllint

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.