Re: [xml] redicting parts of trees



cazic gmx net wrote:


Yeah, sorry, my example makes no sense; the error was in the first branch,
which should look like this:

<a1>
 <a2 xmlns:bar="urn:test:OTHER">
   <foo:a3/>
 </a2>
</a>

with foo bound to "urn:test:mine" initially.
I can see where you get that now. (Note that your closing tag is wrong - should be </a1>). I had implemented my reconciles a few years back when just starting out with the libxml code, so not sure if it is the correct way to do it or not, but I reconcile the new appended element - a1 - and not the parent element - p - as I did experience what you see and figured passing in appended element is the correct way to do it.

My output - reconciling on appended element:
<?xml version="1.0"?>
<p xmlns:bar="urn:test:mine"><a1 xmlns:foo="urn:test:mine">
 <a2 xmlns:bar="urn:test:OTHER">
   <foo:a3/>
 </a2>
</a1></p>

One more thing, can xmlNewReconciliedNs be added to tree.h as its currently defined within tree.c?

When adding a single attribute with a namespace, couldn't it be done just by:
attr->ns = xmlNewReconciliedNs(attr->doc, attr->parent, attr->ns);

rather than having to reconcile the entire parent element, i.e. - xmlReconciliateNs(attr->doc, attr->nodep);

Rob




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