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 683109 - xmlDocDumpFormatMemoryEnc and xmlNodeDumpOutput do not remove characters that are illegal in an XML document
xmlDocDumpFormatMemoryEnc and xmlNodeDumpOutput do not remove characters that...
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: general
git master
Other Mac OS
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2012-08-31 14:34 UTC by Ewout
Modified: 2021-07-05 13:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example source file (line 36 is relevant) (1.17 KB, application/octet-stream)
2012-08-31 14:34 UTC, Ewout
Details

Description Ewout 2012-08-31 14:34:56 UTC
Created attachment 223071 [details]
Example source file (line 36 is relevant)

Some characters may never appear in an XML document.

http://www.w3.org/TR/2008/REC-xml-20081126/#dt-character

While xmlSaveFormatFileEnc does remove such characters from the output, the functions xmlDocDumpFormatMemoryEnc and xmlNodeDumpOutput that dump xml in memory do not, at least not when an encoding is specified.

To reproduce the problem, see the attached example.c, which is a slight modification of the io2 example.

 gcc -I./include example.c ./.libs/libxml2.so && ./a.out | ./xmllint -

Note:
When no encoding is specified (encoding parameter is NULL), we get a warning on the console "xmlEscapeEntities : char out of range" and the text node is removed from the tree.
Comment 1 GNOME Infrastructure Team 2021-07-05 13:20:44 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.