94#define LYXML_ELEM_MIXED 0x01
121#define LYXML_PARSE_MULTIROOT 0x01
126#define LYXML_PARSE_NOMIXEDCONTENT 0x02
169#define LYXML_PRINT_OPEN 0x01
173#define LYXML_PRINT_FORMAT 0x02
177#define LYXML_PRINT_CLOSE 0x04
181#define LYXML_PRINT_ATTRS 0x08
184#define LYXML_PRINT_SIBLINGS 0x10
189#define LYXML_PRINT_NO_LAST_NEWLINE 0x20
245int lyxml_print_clb(ssize_t (*writeclb)(
void *arg,
const void *buf,
size_t count),
void *arg,
const struct lyxml_elem *elem,
int options);
const struct lyxml_ns * ns
struct lyxml_elem * child
struct lyxml_elem * parent
int lyxml_print_mem(char **strp, const struct lyxml_elem *elem, int options)
Dump XML tree to a IO stream.
int lyxml_print_fd(int fd, const struct lyxml_elem *elem, int options)
Dump XML tree to a IO stream.
struct lyxml_elem * lyxml_dup(struct ly_ctx *ctx, struct lyxml_elem *root)
Duplicate the XML tree into the different content.
enum lyxml_attr_type LYXML_ATTR_TYPE
enumeration of attribute types
const 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.
int lyxml_print_file(FILE *stream, const struct lyxml_elem *elem, int options)
Dump XML tree to a IO stream.
void lyxml_free_withsiblings(struct ly_ctx *ctx, struct lyxml_elem *elem)
Free (and unlink from the XML tree) the specified (sub)tree with all its attributes and namespace def...
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.
lyxml_attr_type
enumeration of attribute types
void lyxml_unlink(struct ly_ctx *ctx, struct lyxml_elem *elem)
Unlink the element from its parent. In contrast to lyxml_free(), after return the caller can still ma...
void lyxml_free(struct ly_ctx *ctx, struct lyxml_elem *elem)
Free (and unlink from the XML tree) the specified element with all its attributes and namespace defin...
int lyxml_print_clb(ssize_t(*writeclb)(void *arg, const void *buf, size_t count), void *arg, const struct lyxml_elem *elem, int options)
Dump XML tree to a IO stream.
struct lyxml_elem * lyxml_parse_path(struct ly_ctx *ctx, const char *filename, int options)
Parse XML from filesystem.
struct lyxml_elem * lyxml_parse_mem(struct ly_ctx *ctx, const char *data, int options)
Parse XML from in-memory string.
Element's attribute definition.
Structure describing an element in an XML tree.