1 #ifndef DYNAMIC_DEPTH_INTERNAL_XMPMETA_XML_SEARCH_H_ // NOLINT 2 #define DYNAMIC_DEPTH_INTERNAL_XMPMETA_XML_SEARCH_H_ // NOLINT 3 4 #include <libxml/tree.h> 5 6 // Performs searches an XML tree. 7 namespace dynamic_depth { 8 namespace xmpmeta { 9 namespace xml { 10 11 // Depth-first search on the nodes in this XML doc. 12 // Performs Depth first search on the child XML elements in order. 13 // Returns the first child element with a matching node name. If not found, 14 // returns a null pointer. 15 xmlNodePtr DepthFirstSearch(const xmlDocPtr parent, const char* name); 16 17 // Returns the first child element with a matching prefix and name. 18 // If prefix is null or empty, this has the same effect as the method abouve. 19 // Otherwise, the resulting node's namespace and its name must not be null. 20 xmlNodePtr DepthFirstSearch(const xmlDocPtr parent, const char* prefix, 21 const char* name); 22 23 // Depth-first search on the parent, for a child element with the given name. 24 // The element name excludes its prefix. 25 // Returns a null pointer if no matching element is found. 26 xmlNodePtr DepthFirstSearch(const xmlNodePtr parent, const char* name); 27 28 // Returns the first child element with a matching prefix and name. 29 // If prefix is null or empty, this has the same effect as the method abouve. 30 // Otherwise, the resulting node's namespace and its name must not be null. 31 xmlNodePtr DepthFirstSearch(const xmlNodePtr parent, const char* prefix, 32 const char* name); 33 34 } // namespace xml 35 } // namespace xmpmeta 36 } // namespace dynamic_depth 37 38 #endif // DYNAMIC_DEPTH_INTERNAL_XMPMETA_XML_SEARCH_H_ // NOLINT 39