[gxml] Added set_namespace() to Node



commit 4e942c5f3ef202473c8e0babf7053c8dd0e47aa1
Author: Daniel Espinosa <esodan gmail com>
Date:   Fri Feb 6 00:43:50 2015 -0600

    Added set_namespace() to Node
    
    * Added unit test for namespace

 docs/valadoc/Makefile.am |    2 ++
 gxml/BackedNode.vala     |    4 ++--
 test/GXmlTest.vala       |    1 +
 test/Makefile.am         |    1 +
 4 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/docs/valadoc/Makefile.am b/docs/valadoc/Makefile.am
index a66aac2..da0c37c 100644
--- a/docs/valadoc/Makefile.am
+++ b/docs/valadoc/Makefile.am
@@ -1,3 +1,5 @@
+SUBDIRS=
+
 # inspired by folks' documentation Makefile.am
 
 # distclean_dirs? 
diff --git a/gxml/BackedNode.vala b/gxml/BackedNode.vala
index d0e0dc5..c681773 100644
--- a/gxml/BackedNode.vala
+++ b/gxml/BackedNode.vala
@@ -104,14 +104,14 @@ namespace GXml {
                {
                        for (Xml.Ns *cur = node->ns_def; cur != null; cur = cur->next) {
                                if ((string) cur->prefix == prefix && (string) cur->href == uri) {
-                                       this.node->ns = cur;
+                                       node->set_ns (cur);
                                        return true;
                                }
                        }
                        // Not found in this node, searching on root element
                        for (Xml.Ns *cur = owner_document.document_element.node->ns_def; cur != null; cur = 
cur->next) {
                                if ((string) cur->prefix == prefix && (string) cur->href == uri) {
-                                       this.node->ns = cur;
+                                       this.node->set_ns (cur);
                                        return true;
                                }
                        }
diff --git a/test/GXmlTest.vala b/test/GXmlTest.vala
index 5e7b946..c4382b0 100644
--- a/test/GXmlTest.vala
+++ b/test/GXmlTest.vala
@@ -31,6 +31,7 @@ class GXmlTest {
                NodeTest.add_tests ();
                ElementTest.add_tests ();
                AttrTest.add_tests ();
+               NamespaceTest.add_tests ();
                NodeListTest.add_tests ();
                TextTest.add_tests ();
                CharacterDataTest.add_tests ();
diff --git a/test/Makefile.am b/test/Makefile.am
index 648eb69..e628b10 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -31,6 +31,7 @@ sources = \
        NodeTest.vala \
        ElementTest.vala \
        GXmlTest.vala \
+       NamespaceTest.vala \
        NodeListTest.vala \
        TextTest.vala \
        ValaLibxml2Test.vala \


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