[gxml] DomNode: Some fixes



commit afba93663c8c99ff5d7f5d21303e6702385364a6
Author: Daniel Espinosa <esodan gmail com>
Date:   Wed Oct 26 17:51:22 2016 -0500

    DomNode: Some fixes

 gxml/DomNode.vala  |    7 +++----
 gxml/NodeType.vala |    1 -
 2 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/gxml/DomNode.vala b/gxml/DomNode.vala
index db097ef..afcf088 100644
--- a/gxml/DomNode.vala
+++ b/gxml/DomNode.vala
@@ -79,7 +79,7 @@ public interface GXml.DomNode : GLib.Object, GXml.DomEventTarget {
   public abstract DomNode append_child (DomNode node) throws GLib.Error;
   public abstract DomNode replace_child (DomNode node, DomNode child) throws GLib.Error;
   public abstract DomNode remove_child (DomNode child) throws GLib.Error;
-  public abstract DomNode clone_node (bool deep = false) {
+  public abstract DomNode clone_node (bool deep = false);
     /**
    * Copy a {@link GXml.DomNode} relaying on {@link GXml.DomDocument} to other {@link GXml.DomNode}.
    *
@@ -104,7 +104,7 @@ public interface GXml.DomNode : GLib.Object, GXml.DomEventTarget {
     GLib.message ("Copying source and destiny nodes are GXml.Elements... copying...");
     GLib.message ("Copying source's attributes to destiny node");
 #endif
-      foreach (GXml.DomNode p in source._attributes.values) {
+      foreach (GXml.DomNode p in (source as DomElement).attributes.values) {
         ((GXml.DomElement) node).set_attribute (p.node_name, p.node_value); // TODO: Namespace
       }
       if (!deep) return true;
@@ -128,7 +128,7 @@ public interface GXml.DomNode : GLib.Object, GXml.DomEventTarget {
             GLib.warning (_("Text node with NULL string"));
             continue;
           }
-          var t = doc.create_text ((c as DomText).data);
+          var t = doc.create_text_node ((c as DomText).data);
           node.child_nodes.add (t);
 #if DEBUG
           GLib.message (@"Copying source's Text node '$(source.node_name)' to destiny node with text: 
$(c.node_value) : Size= $(node.child_nodes.size)");
@@ -139,7 +139,6 @@ public interface GXml.DomNode : GLib.Object, GXml.DomEventTarget {
     }
     return false;
   }
-  }
 }
 
 public errordomain GXml.DomError {
diff --git a/gxml/NodeType.vala b/gxml/NodeType.vala
index 738e0b9..d99e6d5 100644
--- a/gxml/NodeType.vala
+++ b/gxml/NodeType.vala
@@ -29,7 +29,6 @@
  *
  * For more, see: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-1950641247]]
  */
-[Version (deprecated=true, deprecated_since="0.12", replacement="DomNode.NodeType")]
 public enum GXml.NodeType { // TODO: Rename to DomNodeType
        /* NOTE: bug in vala?  if I don't have == 0, I fail when creating
           this class because I can't set default values for NodeType properties


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