20 #include "Internal.hpp"
43 S_Xml_Ns Xml_Attr::ns() LY_NEW(attr, ns,
Xml_Ns);
53 S_Xml_Elem
Xml_Elem::child() {
return elem->
child ? std::make_shared<Xml_Elem>(context, elem->child, deleter) :
nullptr;}
54 S_Xml_Elem
Xml_Elem::next() {
return elem->
next ? std::make_shared<Xml_Elem>(context, elem->
next, deleter) :
nullptr;}
55 S_Xml_Elem
Xml_Elem::prev() {
return elem->
prev ? std::make_shared<Xml_Elem>(context, elem->
prev, deleter) :
nullptr;}
57 const
char *
Xml_Elem::get_attr(const
char *name, const
char *ns) {
62 return elem->
ns ? std::make_shared<Xml_Ns>((
struct lyxml_ns *)ns, deleter) :
nullptr;
72 std::string s_data = data;
78 std::vector<S_Xml_Elem> s_vector;
82 s_vector.push_back(std::make_shared<Xml_Elem>(context, elem, deleter));
88 std::vector<S_Xml_Elem> s_vector;
92 s_vector.push_back(std::make_shared<Xml_Elem>(context, elem, deleter));
std::vector< S_Xml_Elem > tree_for()
class for wrapping lyxml_ns.
int lyxml_print_mem(char **strp, const struct lyxml_elem *elem, int options)
Dump XML tree to a IO stream.
Element's attribute definition.
struct lyxml_elem * parent
Class implementation for libyang C header xml.h.
struct lyxml_ns * lyxml_get_ns(const struct lyxml_elem *elem, const char *prefix)
Get namespace definition of the given prefix in context of the specified element. ...
Xml_Ns(const struct lyxml_ns *ns, S_Deleter deleter)
S_Xml_Ns get_ns(const char *prefix)
Public API of libyang XML parser.
std::string print_mem(int options)
#define LY_TREE_DFS_BEGIN(START, NEXT, ELEM)
Macro to iterate via all elements in a tree. This is the opening part to the LY_TREE_DFS_END - they a...
Structure describing an element in an XML tree.
#define LY_TREE_DFS_END(START, NEXT, ELEM)
#define LY_TREE_FOR(START, ELEM)
Macro to iterate via all sibling elements without affecting the list itself.
const char * lyxml_get_attr(const struct lyxml_elem *elem, const char *name, const char *ns)
Get value of the attribute in the specified element.
std::vector< S_Xml_Elem > tree_dfs()