From: daleharvey Date: Tue, 1 Aug 2006 14:23:19 +0000 (+0000) Subject: added getFirstChild() and exists() to pedrodom X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d8abdd4cab10ca228b11033f3f1fb86e984bdf6c;p=inkscape.git added getFirstChild() and exists() to pedrodom --- 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