basic-xml 1.0.1
Very basic loader/writer of XML tags with attributes and content.
|
The Basic XML library and tools are used to handle very basic XML files. At the moment, the library can load a file composed of XML tags with attributes and text. It does not support anything more. This is primarily useful for simple tree based files defining settings.
You can use this library to read simple XML files. Just define an XML object and get the root to go through the tree of nodes.
The nodes have the following basic functions:
Other functions are available but the ones above should generally be sufficient to go through all the nodes as required by your application.
The project includes the basic-xml
tool which can be used to reformat an XML file in one long line, extract a value, or lint a file.
The library allows you to specify a C++ stream as input. This allows you to read from stdin:
The library can be used to safely create an XML file (i.e. making sure that closing tags will always be present, that tag names are valid tokens, that attributes are defined as expected, etc.) For that purpose, create a root node and then print the result once done.
Note that the library does not allow for deleting tags. In other words, you need to create the correct file from the start.
This document is part of the Snap! Websites Project.
Copyright by Made to Order Software Corp.