Code

plumb document references a little deeper in
[inkscape.git] / src / xml / simple-document.cpp
index 4063abde4be867cb0cdc662a362ecddec4273601..0a2cb15fb67b79716e8bd8944cc13ea7fec56931 100644 (file)
  *
  */
 
+#include <glib.h> // g_assert()
+
 #include "xml/simple-document.h"
 #include "xml/event-fns.h"
 #include "xml/element-node.h"
 #include "xml/text-node.h"
 #include "xml/comment-node.h"
+#include "xml/pi-node.h"
 
 namespace Inkscape {
 
@@ -52,15 +55,19 @@ Inkscape::XML::Event *SimpleDocument::commitUndoable() {
 }
 
 Node *SimpleDocument::createElement(char const *name) {
-    return new ElementNode(g_quark_from_string(name));
+    return new ElementNode(g_quark_from_string(name), this);
 }
 
 Node *SimpleDocument::createTextNode(char const *content) {
-    return new TextNode(Util::share_string(content));
+    return new TextNode(Util::share_string(content), this);
 }
 
 Node *SimpleDocument::createComment(char const *content) {
-    return new CommentNode(Util::share_string(content));
+    return new CommentNode(Util::share_string(content), this);
+}
+
+Node *SimpleDocument::createPI(char const *target, char const *content) {
+    return new PINode(g_quark_from_string(target), Util::share_string(content), this);
 }
 
 void SimpleDocument::notifyChildAdded(Node &parent,