Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Level of indentation in xmllint

Tags:

xml

xmllint

By default xmllint appears to indent by 2 spaces, Is there a way to change the level of indentation on Windows?

like image 491
user1322582 Avatar asked Apr 30 '12 15:04

user1322582


1 Answers

I think you need to set the environment variable $XMLLINT_INDENT to be whatever you need (e.g. if you want 4 spaces use four spaces "    "). From the docs:

$XMLLINT_INDENT environment variable controls the indentation (default value is two spaces " ")

You then need to run it with the --format flag. e.g.:

xmllint --format my_file_name.xml
like image 134
Mark Rhodes Avatar answered Sep 28 '22 08:09

Mark Rhodes