/src/dom-extended.vala

http://libgdom3.googlecode.com/ · Vala · 49 lines · 41 code · 3 blank · 5 comment · 1 complexity · dbe605b1c8aa61e52198c4bde85cdc2b MD5 · raw file

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