From d8abdd4cab10ca228b11033f3f1fb86e984bdf6c Mon Sep 17 00:00:00 2001 From: daleharvey Date: Tue, 1 Aug 2006 14:23:19 +0000 Subject: [PATCH] added getFirstChild() and exists() to pedrodom --- src/pedro/pedrodom.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pedro/pedrodom.h b/src/pedro/pedrodom.h index b9fb98b92..cc9a322f9 100644 --- a/src/pedro/pedrodom.h +++ b/src/pedro/pedrodom.h @@ -176,6 +176,9 @@ public: Element *getParent() { return parent; } + Element *getFirstChild() + { return (children.size() == 0) ? NULL : children[0]; } + std::vector getChildren() { return children; } @@ -196,6 +199,8 @@ public: void addNamespace(const DOMString &prefix, const DOMString &namespaceURI); + bool exists(const DOMString &name) + { return (findElements(name).size() > 0); } /** * Prettyprint an XML tree to an output stream. Elements are indented -- 2.30.2