X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=xmltooling%2Futil%2FXMLHelper.cpp;h=7a68ef460ff900b170d8406670318de88ae8e4f5;hb=65b795f1068218ffddebac9aa254ca4456ede47d;hp=4ff6535ad7bf10a4330c2eaade22a1837a29838e;hpb=8b09347f71bdbf2d58fd4db3a7353145be017305;p=shibboleth%2Fcpp-xmltooling.git diff --git a/xmltooling/util/XMLHelper.cpp b/xmltooling/util/XMLHelper.cpp index 4ff6535..7a68ef4 100644 --- a/xmltooling/util/XMLHelper.cpp +++ b/xmltooling/util/XMLHelper.cpp @@ -104,6 +104,24 @@ const XMLObject* XMLHelper::getXMLObjectById(const XMLObject& tree, const XMLCh* return NULL; } +XMLObject* XMLHelper::getXMLObjectById(XMLObject& tree, const XMLCh* id) +{ + if (XMLString::equals(id, tree.getXMLID())) + return &tree; + + XMLObject* ret; + const list& children = tree.getOrderedChildren(); + for (list::const_iterator i=children.begin(); i!=children.end(); ++i) { + if (*i) { + ret = getXMLObjectById(*(*i), id); + if (ret) + return ret; + } + } + + return NULL; +} + QName* XMLHelper::getNodeQName(const DOMNode* domNode) { if (domNode)