From 6dd9754bb73589abb7d55186f8ec15d67d91b70d Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sat, 24 Jul 2004 22:33:28 +0000 Subject: - Some wording changes --- src/domhelpers.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/domhelpers.cpp') 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) -- cgit v1.2.3