Hi Nikolay,

On 11/15/11 07:19, Nikolay Sivov wrote:
-    if ((ns = xmlGetNsList(This->node->doc, This->node)))
+    switch (This->node->type)
      {
-        if (ns[0]->prefix) *prefix = bstr_from_xmlChar( ns[0]->prefix );
-        xmlFree(ns);
+    case XML_ELEMENT_NODE:
+    case XML_ATTRIBUTE_NODE:
+    {
+        xmlNsPtr ns = This->node->ns;
+        if (ns&&  ns->prefix)
+            *prefix = bstr_from_xmlChar(ns->prefix);
+        break;
      }
+    default:
+        FIXME("unsupported type %d\n", This->node->type);
+    };

The idea behind node inheritance rewrite was to avoid such switches. If other node types should be handled differently, they simply shouldn't use node_get_prefix or the differences should be moved to child objects.

Jacek


Reply via email to