[xml] does xmlReconciliateNs() its job incomplete?



hello daniel, all,

while testing i found xmlReconciliateNs() ignores namespaces previously defined
in the (optional) parent tree. i though the correct behaviour of this function
was to fix the namespace declarations in the entire tree.

for example adding '<foo:elem xmlns:foo="bar"/>' to the root element of 
the following document

<?xml version="1.0"?>
<foo:root xmlns:foo="bar"/>

will result

<?xml version="1.0"?>
<foo:root xmlns:foo="bar"><foo:elem xmlns:foo="bar"/></foo:root>

instead of (what i would expect)

<?xml version="1.0"?>
<foo:root xmlns:foo="bar"><foo:elem/></foo:root>

after running xmlReconciliateNs() on that element. i don't think this the 
intended behaviour (or at least it looks wrong to me). 

if my asumptation is correct and this is the wrong behaviour, i could provide
a patch that fixes it. 

also i wonder why the parent node of a namespace declaration is 
not available from the declaration itself. i remember this issue was discussed
some time ago, but i can't remember (nor find) why only the '_private' member 
was added to the xmlNs structure. i think some operations could be speeded 
up (e.g.  reconciliate) if the parent node would be available.

thanks 
christian



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