[gxml] Fixed writing out all declared NS in node for TDocument.start_node()



commit 8c48516cdd1ae526069bbbfd8d47ea18e93bdbec
Author: Daniel Espinosa <esodan gmail com>
Date:   Wed Mar 9 12:54:16 2016 -0600

    Fixed writing out all declared NS in node for TDocument.start_node()

 gxml/TDocument.vala |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gxml/TDocument.vala b/gxml/TDocument.vala
index 966c95f..3959830 100644
--- a/gxml/TDocument.vala
+++ b/gxml/TDocument.vala
@@ -287,6 +287,13 @@ public class GXml.TDocument : GXml.TNode, GXml.Document
 #if DEBUG
     GLib.message (@"Starting Element '$(node.name)': writting attributes");
 #endif
+      foreach (Namespace ns in node.namespaces) {
+        // Declare all namespaces in node
+        GLib.message ("Current Ns:"+ns.uri+":: on Node:"+node.name);
+        if (declared_ns.contains (ns.uri)) continue;
+        tw.write_attribute ("xmlns:"+ns.prefix, ns.uri);
+        declared_ns.add (ns.uri);
+      }
       foreach (GXml.Node attr in node.attrs.values) {
         if (attr.namespaces.size > 0) {
 #if DEBUG


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