[gxml] Fixed XParser write document_element default namespace



commit 52276ae2b756b4c13029f6d8ef7ad1c8ce16d06b
Author: Daniel Espinosa <esodan gmail com>
Date:   Mon Jan 23 10:20:18 2017 -0600

    Fixed XParser write document_element default namespace

 gxml/XParser.vala |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/gxml/XParser.vala b/gxml/XParser.vala
index 8ea396a..63efbca 100644
--- a/gxml/XParser.vala
+++ b/gxml/XParser.vala
@@ -594,22 +594,15 @@ public class GXml.XParser : Object, GXml.Parser {
       GLib.message (@"Starting Element... '$(node.node_name)'");
       GLib.message (@"Element Document is Null... '$((node.owner_document == null).to_string ())'");
 #endif
-      if ((node as DomElement).prefix != null
-          || (node as DomElement).namespace_uri != null) {
-        string name = (node as DomElement).prefix
-                      + ":" + (node as DomElement).local_name;
-        tw.start_element (name);
-      }
-      if ((node as DomElement).prefix == null
-            && (node as DomElement).namespace_uri != null) {
+      if ((node as DomElement).namespace_uri != null) {
 #if DEBUG
             GLib.message ("Writting namespace definition for node");
 #endif
-          tw.start_element_ns (null,
+          tw.start_element_ns ((node as DomElement).prefix,
                                (node as DomElement).local_name,
                                (node as DomElement).namespace_uri);
       } else
-        tw.start_element (node.node_name);
+        tw.start_element ((node as DomElement).local_name);
 #if DEBUG
     GLib.message ("Write down properties: size:"+(node as DomElement).attributes.size.to_string ());
 #endif


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