xmllint failed to properly `--format` certain SVG image
Refer the attached SVG image for a sample, after formatting(--huge --format
) notice that:
- At line 3, the
metadata
,rdf:RDF
,cc:Work
,dc:format
,dc:type
,defs
, andsodipodi:nameview
elements are not separated to individual lines. - At last line (line 8),
<g>
,<path />
,</g>
, and</svg>
elements are all on the same line.
It appears that the formatting is broken to a degree, which matches the result of http://xmlbeautifier.com/ but not https://codebeautify.org/xmlvalidator, which seems to use a different algorithm.
Additional Information
xmllint --version
xmllint: using libxml version 20903
compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib Lzma
libxml
2.9.3 from Ubuntu 16.04 (pkg version: 2.9.3+dfsg1-1ubuntu0.5)