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 142880 - Would like to remove redundant NS declarations from a DOM tree
Would like to remove redundant NS declarations from a DOM tree
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: general
2.6.9
Other Windows
: Normal enhancement
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2004-05-21 07:58 UTC by Steve Hay
Modified: 2021-07-05 13:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Steve Hay 2004-05-21 07:58:16 UTC
I previously requested an API to remove redundant NS declarations in bug 120981
(http://bugzilla.gnome.org/show_bug.cgi?id=120981).  In response, a new parser
option (nsclean) was added in 2.6.0.

That's fantastic, but what I now find myself wanting is the ability to apply
such NS cleanups to a DOM tree itself at a later stage, after parsing.

The problem is that after building a DOM tree (with NS's cleaned up), some of
the manipulations that I make later (inserting new nodes etc) can introduce
redundant declarations again.

I would like to be able to clean up such declarations before I write the tree
back to a file.  At the moment the only way that I can write out a "clean" XML
file is to write the DOM tree once (just to a string suffices), then reparse it
using the nsclean parser option, then write it out to the file for real.

It would be great to have something like a xmlNsClean() function that can be
called on the DOM document before writing the file.

Alternatively, perhaps new xmlSave*() functions (or new options for existing
functions) could be introduced to do the clean-up as the file is being written.

- Steve
Comment 1 Daniel Veillard 2004-05-27 15:59:08 UTC
Okay that's a request for improvement, namespace "cleanup" could be done
both ways, the first one could lead to an easy but inefficient implementation
of the second method. Might be easiest.
Lack of time means it will be done faster if you help building such a patch
(then post on the list).

Daniel
Comment 2 Daniel Veillard 2004-08-14 11:12:54 UTC
Still no progress, nobody worked on this yet,

Daniel
Comment 3 GNOME Infrastructure Team 2021-07-05 13:23:11 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.