[gxml] Set version to 0.9.0



commit ceb4575c2f3b2bdabf713584756a7bf5f9225888
Author: Daniel Espinosa <esodan gmail com>
Date:   Tue Jan 26 13:51:43 2016 -0600

    Set version to 0.9.0

 configure.ac             |    4 ++--
 gxml/Makefile.am         |    3 ++-
 gxml/Node.vala           |   28 ++++++++++++++++++++++++++++
 gxml/libxml-Element.vala |    4 ++--
 4 files changed, 34 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b5a93cc..b2ea9fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,8 +11,8 @@
 
 # Release Version
 m4_define([project_major_version], [0])
-m4_define([project_minor_version], [8])
-m4_define([project_micro_version], [2])
+m4_define([project_minor_version], [9])
+m4_define([project_micro_version], [0])
 m4_define([project_nano_version], [0])
 
 # LT_VERSION
diff --git a/gxml/Makefile.am b/gxml/Makefile.am
index b3bbc33..3d8e619 100644
--- a/gxml/Makefile.am
+++ b/gxml/Makefile.am
@@ -82,7 +82,8 @@ sources = \
        TwNamespace.vala \
        TwNode.vala \
        TwProcessingInstruction.vala \
-       TwText.vala
+       TwText.vala \
+       GHtml.vala
 
 
 ### General Compilation flags
diff --git a/gxml/Node.vala b/gxml/Node.vala
index d229f13..cc47a34 100644
--- a/gxml/Node.vala
+++ b/gxml/Node.vala
@@ -59,6 +59,34 @@ public interface GXml.Node : Object
    */
   public abstract GXml.Document document { get; }
   /**
+   * Get first child with given name, or null. 
+   */
+  public new GXml.Node? get (string key) {
+    foreach (var child in childs)
+      if (child.name == key)
+        return child;
+    return null;
+  }
+  /**
+   * Search all child { link GXml.Element} with a given property's name and with
+   * value contained in text.
+   */
+  public virtual Gee.List<GXml.Node>
+   get_elements_by_property_value (string property, string value)
+  {
+    var list = new Gee.ArrayList<GXml.Node>();
+    foreach (var child in childs) {
+      list.add_all (child.get_elements_by_property_value (property, value));
+      if (child is GXml.Element) {
+        var cls = (child as GXml.Element).get_attribute (property);
+        if (cls == null) continue;
+        if (value in child.content)
+            list.add (child);
+      }
+    }
+    return list;
+  }
+  /**
    * Node's string representation.
    */
   public abstract string to_string ();
diff --git a/gxml/libxml-Element.vala b/gxml/libxml-Element.vala
index b8fdb9c..c55bf7e 100644
--- a/gxml/libxml-Element.vala
+++ b/gxml/libxml-Element.vala
@@ -443,8 +443,8 @@ namespace GXml {
                        owned get {
                                _content = "";
                                foreach (xNode n in child_nodes) {
-                                       if (n is xText) {
-                                               _content += n.value;
+                                       if (n is xCharacterData) {
+                                               _content += n.data;
                                        }
                                }
                                return _content;


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