17 #ifndef _ASTERISK_XML_H 18 #define _ASTERISK_XML_H 26 struct ast_xml_xpath_results;
74 struct ast_xml_node *
ast_xml_new_child(
struct ast_xml_node *parent,
const char *child_name);
83 struct ast_xml_node *
ast_xml_add_child(
struct ast_xml_node *parent,
struct ast_xml_node *child);
185 struct ast_xml_node *
ast_xml_find_element(
struct ast_xml_node *root_node,
const char *
name,
const char *attrname,
const char *attrvalue);
264 struct ast_xml_xpath_results *
ast_xml_query(
struct ast_xml_doc *doc,
const char *xpath_str);
int ast_xml_init(void)
Initialize the XML library implementation. This function is used to setup everything needed to start ...
const char * ast_xml_get_ns_href(struct ast_xml_ns *ns)
struct ast_xml_doc * ast_xml_open(char *filename)
Open an XML document.
struct ast_xml_doc * ast_xml_new(void)
Create a XML document.
void ast_xml_free_node(struct ast_xml_node *node)
Free node.
struct ast_xml_node * ast_xml_add_child(struct ast_xml_node *parent, struct ast_xml_node *child)
Add a child node, to a specified parent node.
int ast_xml_doc_dump_file(FILE *output, struct ast_xml_doc *doc)
Dump the specified document to a file.
int ast_xml_xpath_num_results(struct ast_xml_xpath_results *results)
Return the number of results from an XPath query.
struct ast_xml_node * ast_xml_get_root(struct ast_xml_doc *doc)
Get the document root node.
struct ast_xml_node * ast_xml_new_child(struct ast_xml_node *parent, const char *child_name)
Add a child node inside a passed parent node.
struct ast_xml_doc * ast_xml_get_doc(struct ast_xml_node *node)
Get the document based on a node.
const char * ast_xml_get_attribute(struct ast_xml_node *node, const char *attrname)
Get a node attribute by name.
void ast_xml_free_attr(const char *attribute)
Free an attribute returned by ast_xml_get_attribute()
struct ast_xml_node * ast_xml_add_child_list(struct ast_xml_node *parent, struct ast_xml_node *child)
Add a list of child nodes, to a specified parent node.
struct ast_xml_node * ast_xml_find_element(struct ast_xml_node *root_node, const char *name, const char *attrname, const char *attrvalue)
Find a node element by name.
struct ast_xml_node * ast_xml_new_node(const char *name)
Create a XML node.
struct ast_xml_xpath_results * ast_xml_query(struct ast_xml_doc *doc, const char *xpath_str)
Execute an XPath query on an XML document.
void ast_xml_set_root(struct ast_xml_doc *doc, struct ast_xml_node *node)
Specify the root node of a XML document.
void ast_xml_set_text(struct ast_xml_node *node, const char *content)
Set an element content string.
struct ast_xml_node * ast_xml_node_get_parent(struct ast_xml_node *node)
Get the parent of a specified node.
struct ast_xml_node * ast_xml_copy_node_list(struct ast_xml_node *list)
Create a copy of a n ode list.
void ast_xml_xpath_results_free(struct ast_xml_xpath_results *results)
Free the XPath results.
void ast_xml_close(struct ast_xml_doc *doc)
Close an already open document and free the used structure.
int ast_xml_set_attribute(struct ast_xml_node *node, const char *name, const char *value)
Set an attribute to a node.
const char * ast_xml_get_text(struct ast_xml_node *node)
Get an element content string.
struct ast_xml_node * ast_xml_node_get_prev(struct ast_xml_node *node)
Get the previous node in the same leve.
struct ast_xml_doc * ast_xml_read_memory(char *buffer, size_t size)
Open an XML document that resides in memory.
struct ast_xml_ns * ast_xml_find_namespace(struct ast_xml_doc *doc, struct ast_xml_node *node, const char *ns_name)
struct ast_xml_node * ast_xml_node_get_next(struct ast_xml_node *node)
Get the next node in the same level.
int ast_xml_finish(void)
Cleanup library allocated global data.
struct ast_xml_node * ast_xml_xpath_get_first_result(struct ast_xml_xpath_results *results)
Return the first result node of an XPath query.
struct ast_xml_node * ast_xml_node_get_children(struct ast_xml_node *node)
Get the node's children.
const char * ast_xml_node_get_name(struct ast_xml_node *node)
Get the name of a node.
void ast_xml_free_text(const char *text)
Free a content element that was returned by ast_xml_get_text()