Search code examples
xmllinter

XML indentation characters (xmllint)


I recently installed xmllint in windows using this instructions. However when I run xmllint against any xml file it adds double quotes at the beginning of the line. Example

<?xml version="1.0"?>
<library path="lib/libplugin_triangle">
<class type="triangle::cPlugingTriangle" base_class_type="regular_polygon::cRegularPolygon">
 <description>This is a triangle plugin.</description>
</class>
</library>

becomes

<?xml version="1.0"?>
<library path="lib/libplugin_triangle">
"  " <class type="triangle::cPlugingTriangle" base_class_type="regular_polygon::cRegularPolygon">
"  " "  " <description>This is a triangle plugin.</description>
"  " </class>
</library>

I have played with several definitions of XMLLINT_INDET with the windows environmental variables tool. But nothing happens.

Do these double quotes are legal in XML?


Solution

  • No, these quotes are not XML standard. The problem was my linter manager (ALE) in my editor (vim). It sets up the XMLLINT_INDENT variable to textually " ". That is a bug in ALE. Then xmllint place these characters. I proposed a fix for that error in this pull request,