[gxml] Added GXml.Notation interface
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] Added GXml.Notation interface
- Date: Tue, 12 May 2015 18:26:46 +0000 (UTC)
commit 28caa23749b8670ec83b6878dfb064d70272839d
Author: Daniel Espinosa <esodan gmail com>
Date: Tue May 12 13:25:56 2015 -0500
Added GXml.Notation interface
gxml/Makefile.am | 1 +
gxml/Notation.vala | 40 ++++++++++++++++++++++++++++++++++++++++
gxml/libxml-DocumentType.vala | 6 ++++--
gxml/libxml-Notation.vala | 8 ++------
4 files changed, 47 insertions(+), 8 deletions(-)
---
diff --git a/gxml/Makefile.am b/gxml/Makefile.am
index 79008b1..97ceac4 100644
--- a/gxml/Makefile.am
+++ b/gxml/Makefile.am
@@ -21,6 +21,7 @@ sources = \
Element.vala \
Namespace.vala \
Node.vala \
+ Notation.vala \
Text.vala \
libxml-Attr.vala \
libxml-AttrChildNodeList.vala \
diff --git a/gxml/Notation.vala b/gxml/Notation.vala
new file mode 100644
index 0000000..ea7bb10
--- /dev/null
+++ b/gxml/Notation.vala
@@ -0,0 +1,40 @@
+/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 0; tab-width: 2 -*- */
+/* Notation.vala
+ *
+ * Copyright (C) 2015 Daniel Espinosa <esodan gmail com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * 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/>.
+ *
+ * Authors:
+ * Daniel Espinosa <esodan gmail com>
+ */
+
+using Gee;
+
+/**
+ * Interface to handle notation elements
+ *
+ * Used in defining { link GXml.DocumentType}s to declare the format of
+ * { link GXml.Entity} and { link GXml.ProcessingInstruction}s.
+ *
+ * Used collectively in defining DocumentTypes. A Notation can
+ * declare the format of unparsed entities or
+ * ProcessingInstruction targets.
+ * For more, see: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-5431D1B9]]
+ */
+public interface GXml.Notation : Object, GXml.Node
+{
+ public abstract string? public_id { get; }
+ public abstract string? external_id { get; }
+}
diff --git a/gxml/libxml-DocumentType.vala b/gxml/libxml-DocumentType.vala
index 4d9afc6..2cde22c 100644
--- a/gxml/libxml-DocumentType.vala
+++ b/gxml/libxml-DocumentType.vala
@@ -23,6 +23,8 @@
* Daniel Espinosa <esodan gmail com>
*/
+using Gee;
+
namespace GXml {
/**
* Defines a xDocument, such as the entities that it can use.
@@ -71,7 +73,7 @@ namespace GXml {
* A HashTable of entities defined for this DocumentType.
*/
// TODO: provide examples
- public HashTable<string,Entity>? entities {
+ public Gee.Map<string,Entity>? entities {
get {
// TODO: need to create a HashTable<string,Entity> uniting these two
// discard duplicates
@@ -90,7 +92,7 @@ namespace GXml {
* A HashTable of notations defined for this DocumentType.
*/
// TODO: provide examples
- public HashTable<string,xNotation>? notations {
+ public Gee.Map<string,xNotation>? notations {
get {
// TODO: need to create a HashTable<string,xNotation> uniting the two
// discard duplicates
diff --git a/gxml/libxml-Notation.vala b/gxml/libxml-Notation.vala
index 5f8e62f..640ea63 100644
--- a/gxml/libxml-Notation.vala
+++ b/gxml/libxml-Notation.vala
@@ -32,7 +32,7 @@ namespace GXml {
* ProcessingInstruction targets.
* For more, see: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-5431D1B9]]
*/
- public class xNotation : xNode {
+ public class xNotation : xNode, GXml.Notation {
// private Xml.Notation *notation; // TODO: wrap libxml's xmlNotation
/**
@@ -53,18 +53,14 @@ namespace GXml {
get {
return null; // notation->public_id;
}
- private set {
- }
}
/**
* The system identifier for the notation, or %NULL if not set.
*/
- public string? system_id {
+ public string? external_id {
get {
return null; // notation->system_id;
}
- private set {
- }
}
internal xNotation (/* Xml.Notation *notation, */ xDocument doc) {
base (NodeType.NOTATION, doc); // STUB
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]