After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 602918 - xmllint --format does not respect xml:space
xmllint --format does not respect xml:space
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: general
2.7.3
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2009-11-25 11:04 UTC by sf
Modified: 2021-07-05 13:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description sf 2009-11-25 11:04:14 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
Comment 1 sf 2010-05-12 08:14:40 UTC
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
Comment 2 GNOME Infrastructure Team 2021-07-05 13:21:59 UTC
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.