[gxml] DomElement: Adding set_attribute_ns documentation



commit 28464e3706fc1f6723142aa0c40b2d10d68f44b6
Author: Daniel Espinosa <esodan gmail com>
Date:   Mon Mar 6 11:01:31 2017 -0600

    DomElement: Adding set_attribute_ns documentation
    
    This will help others to define default namespaces or
    namespace declarations, using correct XML namespace URI

 gxml/DomElement.vala      |   12 ++++++++++++
 test/GomDocumentTest.vala |    6 +++---
 2 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/gxml/DomElement.vala b/gxml/DomElement.vala
index c10c5ad..ba7eeda 100644
--- a/gxml/DomElement.vala
+++ b/gxml/DomElement.vala
@@ -46,6 +46,18 @@ public interface GXml.DomElement : GLib.Object,
   public abstract string? get_attribute (string name);
   public abstract string? get_attribute_ns (string? namespace, string local_name);
   public abstract void set_attribute (string name, string value) throws GLib.Error;
+  /**
+   * Set an attribute value to this element. If it doesn't exists yet, it is added
+   * to the list of attributes, unless it is an namespace redefinition.
+   *
+   * To set a namespace declaration [[http://www.w3.org/2000/xmlns]] namespace and xmlns
+   * as prefix. For default namespaces, use xmlns as name without prefix. Namespace
+   * URI will be the one provided as value.
+   *
+   * @param namespace, attribute namespace
+   * @param name, a prefixed attribute name or xmlns for default namespace declaration
+   * @param value, a value for the attribute or URI for namespace declaration
+   */
   public abstract void set_attribute_ns (string? namespace, string name, string value) throws GLib.Error;
   public abstract void remove_attribute (string name);
   public abstract void remove_attribute_ns (string? namespace, string local_name);
diff --git a/test/GomDocumentTest.vala b/test/GomDocumentTest.vala
index 47265b1..b5d05e8 100644
--- a/test/GomDocumentTest.vala
+++ b/test/GomDocumentTest.vala
@@ -1,5 +1,5 @@
 /* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
-/* Notation.vala
+/* GomDocumentTest.vala
  *
  * Copyright (C) 2016 Daniel Espinosa <esodan gmail com>
  *
@@ -7,12 +7,12 @@
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
-
+ *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
-
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  *


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