[xml] Namespace normalization/reconciliation



Hi all;
 I'm struggling with the problem of redundant namespace
declarations; namely if you create a namespaced element (other than
through xmlNewChild), you get an extra namespace declaration
that doesn't go away when the node is inserted into the document.
It's certainly not a question of Correctness, but it can easily
double the size of large documents.

The docs for xmlReconciliateNs sort of suggests that it might do
this type of pruning, but apparently only copes with getting
correct declarations not `optimal' ones.

A search through the archives turned up some previous, similar,
discussions, including a patch from Christian Glahn
 http://mail.gnome.org/archives/xml/2002-September/msg00066.html
but it seems not to have been applied; or I missread it's intent.
Is there a reason not to do this?  Or alternatively, is there
some other procedure for cleaning up NS declarations?
(I couldn't find one via searching)

This would seem to be an important cleanup operation, even if it
isn't fast, since you pay for the excess declarations everytime you use the resulting document.

To confuse matters further, I'm working through the perl bindings
of XML::LibXML, but can add a binding to other functions if
they exist.

Thanks in advance!
--
bruce miller nist gov
http://math.nist.gov/~BMiller/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]