[gxml] * since libxml2's attr isn't really a node, we have to override the functions. Really want to find



commit c240c77d8e6e17a35362793f0a67d6e31d711a48
Author: Richard Schwarting <aquarichy gmail com>
Date:   Tue Aug 9 04:25:51 2011 +0200

    * since libxml2's attr isn't really a node, we have to override the functions.  Really want to find out why Xml.Attr uses ns and why Xml.Node uses ns_def

 gxml/Attr.vala |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)
---
diff --git a/gxml/Attr.vala b/gxml/Attr.vala
index e6e5533..90900e8 100644
--- a/gxml/Attr.vala
+++ b/gxml/Attr.vala
@@ -20,6 +20,47 @@ namespace GXml.Dom {
 	 * Nodes.  For more, see: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-637646024]]
 	 */
 	public class Attr : XNode {
+		/**
+		 * { inheritDoc}
+		 */
+		public override string? namespace_uri {
+			get {
+				// TODO: there can be multiple NSes on a node, using ->next, right now we just return the first.  What should we do?!?!
+				if (this.node->ns == null) {
+					return null;
+				} else {
+					return this.node->ns->href;
+				}
+				// TODO: handle null ns_def
+				// TODO: figure out when node->ns is used, as opposed to ns_def
+			}
+			internal set {
+			}
+		}
+		/**
+		 * { inheritDoc}
+		 */
+		public override string? prefix {
+			get {
+				if (this.node->ns == null) {
+					return null;
+				} else {
+					return this.node->ns->prefix;
+				}
+			}
+			internal set {
+			}
+		}
+		/**
+		 * { inheritDoc}
+		 */
+		public override string? local_name {
+			get {
+				return this.node_name;
+			}
+			internal set {
+			}
+		}
 
 		/** Private properties */
 		private Xml.Attr *node;



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