+bool hasParent(xmlNodePtr theNode)\r
+{\r
+ xmlNodePtr aNode = theNode->parent;\r
+ if (!aNode) {\r
+ return false;\r
+ }\r
+ for (; aNode; aNode = aNode->next) {\r
+ if (isElementNode(theNode)) {\r
+ return true;\r
+ }\r
+ }\r
+ return false;\r
+}\r
+\r
+bool hasParent(xmlNodePtr theNode, const char* theNodeName, ...)\r
+{\r
+ if (!hasParent(theNode)) {\r
+ return false; // have no parents at all\r
+ }\r
+ xmlNodePtr aNode = theNode->parent;\r
+ const xmlChar* aName = aNode->name;\r
+ if (!aName || !isElementNode(aNode)) {\r
+ return false;\r
+ }\r
+ if (!xmlStrcmp(aName, (const xmlChar *) theNodeName)) {\r
+ return true;\r
+ }\r
+ va_list args; // define argument list variable\r
+ va_start(args, theNodeName); // init list; point to last defined argument\r
+ while (true) {\r
+ char *anArg = va_arg (args, char*); // get next argument\r
+ if (anArg == NULL)\r
+ break;\r
+ if (!xmlStrcmp(aName, (const xmlChar *) anArg)) {\r
+ va_end(args); // cleanup the system stack\r
+ return true;\r
+ }\r
+ }\r
+ va_end(args); // cleanup the system stack\r
+ return false;\r
+}\r
+\r
+bool hasParentRecursive(xmlNodePtr theNode, const std::vector<const char*>& theNodeNames)\r
+{\r
+ if (!hasParent(theNode)) {\r
+ return false; // have no parents at all\r
+ }\r
+ xmlNodePtr aNode = theNode->parent;\r
+ const xmlChar* aName = aNode->name;\r
+ if (!aName || !isElementNode(aNode)) {\r
+ return false;\r
+ }\r
+ for (size_t anIndex = 0; anIndex < theNodeNames.size(); ++anIndex) {\r
+ if (!xmlStrcmp(aName, (const xmlChar *) theNodeNames[anIndex]))\r
+ return true;\r
+ }\r
+ return hasParentRecursive(aNode, theNodeNames);\r
+}\r
+\r
+bool hasParentRecursive(xmlNodePtr theNode, const char* theNodeName, ...)\r
+{\r
+ std::vector<const char*> aNodeNames;\r
+ va_list args; // define argument list variable\r
+ va_start(args, theNodeName); // init list; point to last defined argument\r
+ aNodeNames.push_back(theNodeName);\r
+ while (true) {\r
+ char *anArg = va_arg (args, char*); // get next argument\r
+ if (anArg == NULL)\r
+ break;\r
+ aNodeNames.push_back(anArg);\r
+ }\r
+ va_end(args); // cleanup the system stack\r
+ return hasParentRecursive(theNode, aNodeNames);\r
+}\r
+\r
+bool getParametersInfo(xmlNodePtr theNode, std::string& outPropertyId,\r