By default xmllint appears to indent by 2 spaces, Is there a way to change the level of indentation on Windows?
Level of indentation in xmllint
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
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.