PageRenderTime 19ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/dom-extended.vala

http://libgdom3.googlecode.com/
Vala | 49 lines | 41 code | 3 blank | 5 comment | 1 complexity | dbe605b1c8aa61e52198c4bde85cdc2b MD5 | raw file
 1using GLib;
 2using Gee;
 3
 4namespace DOM {
 5	public class Entity : Node {
 6		public Entity (string name) {
 7			base(null, Node.Type.ENTITY_NODE, name);
 8		}
 9		/* Entity Interface */
10		public string notationName;
11		public string publicId;
12		public string systemId;
13	}
14	public class Notation : Node {
15		public Notation (string name) {
16			base(null, Node.Type.NOTATION, name);
17		}
18		/* Notation Interface */
19		public string publicId;
20		public string systemId;
21	}
22
23	public class DocumentType : Node {
24		public DocumentType (string qualifiedName, string publicId, string systemId) {
25			base(null, Node.Type.DOCUMENT_TYPE, qualifiedName);
26			this.publicId = publicId;
27			this.systemId = systemId;
28		}
29		/* DocumentType Interface */
30		public string name {
31			get {return nodeName;}
32		}
33		public Gee.Map<weak string, Entity> entities;
34		public Gee.Map<weak string, Notation> notations;
35		public string publicId {get; construct;}
36		public string systemId {get; construct;}
37		public string internalSubset;
38
39		/* private */
40		public weak string? default_attribute_value(string element, string attr) {
41			/*FIXME: find a good position for this function and write it*/
42			return "";
43		}
44		public string id_attribute_name = "id";
45		public virtual bool isId(string name) {
46			return name == id_attribute_name;
47		}
48	}
49}