From 20b4610931d6a443a9ff056f2366fdddcdb9d2b3 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Thu, 1 Dec 2016 09:37:23 +0000 Subject: [PATCH] README.md edited online with Bitbucket --- README.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..b921578 --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +# README # + +Simple library to read, write and traverse XML files. + +### Usage ### + +This is a simple implementation of XML functions for writing and +reading XML files. For writing an XML file from scratch, following +functions can be used: + + +``` +#!c + + writer = mxml_open_file(file_name); + mxml_start_element(writer, name); + mxml_write_attribute(writer, name, value); + mxml_write_value(writer, value); + mxml_end_element(writer); + ... + mxml_close_file(writer); + +``` + +To read an XML file, the function + + +``` +#!c + + tree = mxml_parse_file(file_name, error, sizeof(error)); + +``` + +is used. It parses the complete XML file and stores it in a +hierarchical tree in memory. Nodes in that tree can be searched +for with + + +``` +#!c + + mxml_find_node(tree, xml_path); + +``` + +or + + +``` +#!c + + mxml_find_nodes(tree, xml_path, &nodelist); + +``` + +which support a subset of the XPath specification. Another set of +functions is availabe to retrieve attributes and values from nodes +in the tree and for manipulating nodes, like replacing, adding and +deleting nodes. + + + +### Copywright ### + +GNU General Public License V2 + +### Contact ### +Stefan Ritt \ No newline at end of file