using namespace xmltooling;
using std::ostream;
+using std::list;
static const XMLCh type[]={chLatin_t, chLatin_y, chLatin_p, chLatin_e, chNull };
return NULL;
}
+const XMLObject* XMLHelper::getXMLObjectById(const XMLObject& tree, const XMLCh* id)
+{
+ if (XMLString::equals(id, tree.getXMLID()))
+ return &tree;
+
+ const XMLObject* ret;
+ const list<XMLObject*>& children = tree.getOrderedChildren();
+ for (list<XMLObject*>::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)
static DOMAttr* getIdAttribute(const DOMElement* domElement);
/**
+ * Attempts to locate an XMLObject from this point downward in the tree whose
+ * XML ID matches the supplied value.
+ *
+ * @param tree root of tree to search
+ * @param id ID value to locate
+ * @return XMLObject in the tree with a matching ID value, or NULL
+ */
+ static const XMLObject* getXMLObjectById(const XMLObject& tree, const XMLCh* id);
+
+
+ /**
* Gets the QName for the given DOM node.
*
* @param domNode the DOM node