#includeusing namespace Poco::XML; void checkTagName(Element& elem) { if (elem.hasTagName("book")) { // code to execute if the tag name of the element is "book" } }
#includeIn this example, we are using the containing class QDomElement and method hasTagName to determine if an XML node's tag name is "employee". Both examples are using different library packages, with the first example using the Poco XML library and the second example using the Qt XML library.using namespace QDom; void checkTagName(QDomElement& elem) { if (elem.hasTagName("employee")) { // code to execute if the tag name of the element is "employee" } }