Level of indentation in xmllint
Asked Answered
I

1

14

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

Ideally answered 30/4, 2012 at 15:6 Comment(0)
A
28

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
Aboveboard answered 30/4, 2012 at 15:12 Comment(5)
I saw that documentation also, but how do you edit that environment variable for XMLLINT_INDENT on a Windows machine?Ideally
You should be able to do it via set or via the my System Properties -> Advanced -> Environment Variables menu.Aboveboard
$XMLLINT_INDENT does not even exist in my system variables. Its simply an application that I have in a folder that is included my path in the environment variables.Ideally
It doesn't exist by default - if you add it, then the program will pick it up.Aboveboard
XMLLINT_INDENT=" " xmllint --html --format - < temp.htm prints no indentation for me.Leighleigha

© 2022 - 2024 — McMap. All rights reserved.