From: Hosang Kim Date: Fri, 28 Jul 2023 11:16:51 +0000 (+0900) Subject: AurumXML: clear XPath cache when findObject is called X-Git-Tag: accepted/tizen/8.0/unified/20231005.093951^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c0de4c4b0e8ab0d6f8600fc17d7b150e4b764c5;p=platform%2Fcore%2Fuifw%2Faurum.git AurumXML: clear XPath cache when findObject is called Change-Id: If04238af44c852029199aad5212d36540f954024 --- diff --git a/libaurum/src/AurumXML.cc b/libaurum/src/AurumXML.cc index a52764a..8f90001 100644 --- a/libaurum/src/AurumXML.cc +++ b/libaurum/src/AurumXML.cc @@ -81,9 +81,10 @@ bool AurumXML::createXMLtree() if (!mDoc || !mRoot) return false; mDoc->remove_children(); + mXNodeMap.clear(); xml_node element = mDoc->append_child(""); - + traverse(element, mRoot); return true; @@ -232,13 +233,14 @@ void AurumXML::findXNodes(std::vector> &ret, if (mXNodeMap.count(id) > 0) ret.push_back(mXNodeMap[id]); } - } + } } void AurumXML::findObjects(std::vector> &ret, std::string xpath, bool earlyReturn) { LOGI("xpath %s earlyReturn %d", xpath.c_str(), earlyReturn); + createXMLtree(); try { findXNodes(ret, xpath, earlyReturn); if (ret.size() == 0) {