GNOME Bugzilla – Bug 602918
xmllint --format does not respect xml:space
Last modified: 2021-07-05 13:21:59 UTC
If whitespace is marked as significant with xml:space="preserve" then it should be preserved even when reformatting. But this is not the case. Steps to Reproduce: Save following as a.xml <a> <b xml:space="preserve"><c/></b> <b xml:space="default"><c/></b> </a> Run xmllint --format a.xml Actual Results: <?xml version="1.0"?> <a> <b xml:space="preserve"> <c/> </b> <b xml:space="default"> <c/> </b> </a> Expected Results: <?xml version="1.0"?> <a> <b xml:space="preserve"><c/></b> <b xml:space="default"> <c/> </b> </a> Version 2.7.3: xmllint: using libxml version 20703 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 Reference: http://www.w3.org/TR/REC-xml/#sec-white-space
Same result in version 2.7.7. xmllint: using libxml version 20707 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
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.