./configure && make && make install
This package provides some convenient (for me) stuff on top of the excellent xmlwrapp package.
E.g. for a configuration file such as the following:
<?xml version="1.0"?>
<xxx-config>
<server>
<port>
1050
</port>
</server>
</xxx-config>
void configure(const std::string& config_fn) throw (std::runtime_error) { Dv::Xml::Document config(config_fn); // parse or throw int port = config.root()/"server"/"port"; // follow path in tree, convert ... }
Building XML documents can be done as in the following example.
Dv::Xml::Node config("xxx-config"); (config >> "server" >> "port") = 1050; // add child and grandchild and set contents Dv::Xml::Node::Ref comment((config/"server")>>"comment"); comment["language"] = "en"; // set attribute comment = "a comment string"; // set content
The package depends on the dvutil and xmlwrapp packages.
dvxml-0.1.4 | [19 September, 2003] |