libyang
1.0.253
YANG data modeling language library
|
Public API of libyang XML parser. More...
#include <sys/types.h>
#include <stdio.h>
Go to the source code of this file.
Data Structures | |
struct | lyxml_ns |
Namespace definition. More... | |
struct | lyxml_attr |
Element's attribute definition. More... | |
struct | lyxml_elem |
Structure describing an element in an XML tree. More... | |
Macros | |
#define | LYXML_ELEM_MIXED 0x01 /* element contains mixed content */ |
#define | LYXML_PARSE_MULTIROOT 0x01 |
#define | LYXML_PARSE_NOMIXEDCONTENT 0x02 |
#define | LYXML_PRINT_OPEN 0x01 |
#define | LYXML_PRINT_FORMAT 0x02 |
#define | LYXML_PRINT_CLOSE 0x04 |
#define | LYXML_PRINT_ATTRS 0x08 |
#define | LYXML_PRINT_SIBLINGS 0x10 |
#define | LYXML_PRINT_NO_LAST_NEWLINE 0x20 |
Typedefs | |
typedef enum lyxml_attr_type | LYXML_ATTR_TYPE |
enumeration of attribute types More... | |
Enumerations | |
enum | lyxml_attr_type { LYXML_ATTR_STD = 1, LYXML_ATTR_NS = 2, LYXML_ATTR_STD_UNRES = 3 } |
enumeration of attribute types More... | |
Functions | |
struct lyxml_elem * | lyxml_parse_mem (struct ly_ctx *ctx, const char *data, int options) |
Parse XML from in-memory string. More... | |
struct lyxml_elem * | lyxml_parse_path (struct ly_ctx *ctx, const char *filename, int options) |
Parse XML from filesystem. More... | |
int | lyxml_print_file (FILE *stream, const struct lyxml_elem *elem, int options) |
Dump XML tree to a IO stream. More... | |
int | lyxml_print_fd (int fd, const struct lyxml_elem *elem, int options) |
Dump XML tree to a IO stream. More... | |
int | lyxml_print_mem (char **strp, const struct lyxml_elem *elem, int options) |
Dump XML tree to a IO stream. More... | |
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. More... | |
struct lyxml_elem * | lyxml_dup (struct ly_ctx *ctx, struct lyxml_elem *root) |
Duplicate the XML tree into the different content. More... | |
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 definitions. More... | |
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 definitions. In contrast to lyxml_free(), free also all the element's siblings (preceding as well as following). More... | |
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 manipulate with the elem. Any namespaces are corrected and copied, if needed. More... | |
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. More... | |
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. More... | |
Public API of libyang XML parser.
This source code is licensed under BSD 3-Clause License (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at
https://opensource.org/licenses/BSD-3-Clause
Definition in file xml.h.