summaryrefslogtreecommitdiff
path: root/src/domhelpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/domhelpers.h')
-rw-r--r--src/domhelpers.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/domhelpers.h b/src/domhelpers.h
index 16afd79..043ffd4 100644
--- a/src/domhelpers.h
+++ b/src/domhelpers.h
@@ -41,16 +41,32 @@
#include "sablo.h"
+/*
+ * DOMHelpers
+ *
+ * A collection of functions for doing some things with an XML DOM.
+ * Used mainly by XMLComposer.
+ */
class DOMHelpers
{
public:
- // DOM Helper Functions
+ // Check if given node is an element with a certain name
static bool isElement(const DOM::Node& node, const string& name);
+
+ // Check if two elements have the same name and attributes
static bool isEqualElement(const DOM::Element& el1, const DOM::Element& el2);
+
+ // Copy attributes from one element to another optionaly ignoring some
static void copyAttributes(const DOM::Element& src, DOM::Element& dest, const char** hideList);
+
+ // Insert a child node after a given reference node
static void insertAfter(DOM::Node& parent, const DOM::Node& node, const DOM::Node& ref);
+
+ // Get containing element of a given name
static DOM::Element getContainingElement(const DOM::Node& node, const string& name);
+
+ // Get previous element (in XML flow) of a given name
static DOM::Element getPriorElement(const DOM::Node& node, const string& name);
};