summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStef <stef@ws.local>2004-07-24 22:33:28 +0000
committerStef <stef@ws.local>2004-07-24 22:33:28 +0000
commitf17c713e64545feb5e9559ae43f6cc8e2a92b7a4 (patch)
tree31b26427bb17b327533f86e8d78c468e20b5a5b8 /src
parent1a0b2fe62cbfd2c0cb3a162787017dce98ed9dc6 (diff)
- Some wording changes
Diffstat (limited to 'src')
-rw-r--r--src/domhelpers.cpp14
-rw-r--r--src/domhelpers.h2
2 files changed, 14 insertions, 2 deletions
diff --git a/src/domhelpers.cpp b/src/domhelpers.cpp
index 7ecf963..038e2df 100644
--- a/src/domhelpers.cpp
+++ b/src/domhelpers.cpp
@@ -179,7 +179,19 @@ void DOMHelpers::insertAfter(DOM::Node& parent, const DOM::Node& node,
parent.insertBefore(node, sibling);
}
-DOM::Element DOMHelpers::getChildElement(const DOM::Node& parent, const string& name)
+DOM::Element DOMHelpers::findChildElement(const DOM::Node& parent, const string& name)
+{
+ DOM::Node child = parent.getFirstChild();
+ while(child != NULL)
+ {
+ if(isElement(child, name))
+ return (DOM::Element&)child;
+ }
+
+ return DOM::Element();
+}
+
+DOM::Element DOMHelpers::findDescendantElement(const DOM::Node& parent, const string& name)
{
DOM::Node child = parent.getFirstChild();
while(child != NULL)
diff --git a/src/domhelpers.h b/src/domhelpers.h
index fd386f8..8b14e2b 100644
--- a/src/domhelpers.h
+++ b/src/domhelpers.h
@@ -73,7 +73,7 @@ public:
static DOM::Element getPriorElement(const DOM::Node& node, const string& name);
// Get first child element of a given name
- static DOM::Element getChildElement(const DOM::Node& parent, const string& name);
+ static DOM::Element findChildElement(const DOM::Node& parent, const string& name);
// Check if a given element is anothers ancestor
static bool hasAncestor(const DOM::Node& ancestor, const DOM::Node& node);