[ home | example of use | documentation | discuss | download ]
Conf2XML is a library that allows to transform a linux configuration file to XML, and to create a configuration file from XML. It's available in C, python, ruby, and perl conf2xml is free software under the GPL license version 2 (not "or upper"). Configuration file ↔ XML !Conf2XML uses a powerful parser and a set of intelligent templates to parse nicely a lot of configuration files types, and not only the simple ones. The parser is very respectful. The order of informations is kept, and so are comments (line comments, C-like comments, and even recursive comments). Conf2XML provides a simple API. conf2xml is used to get an xml string representing the configuration file, and xml2conf to write down a configuration file from a given XML string. The XML format is very simple, the dtd is available in the documentation section. Statusdone :
to be done :
|
News
|
As a human, it's quite easy and convenient to deal with linux configuration files (well, sendmail configuration file is somehow an exception I guess). But when coding a software that have to deal with configuration files for its own use or to get/set informations on the system, it can become quickly painful.
Conf2XML provides an XML bridge to these configuration files. The developper can use any XML parser to edit/set/remove the informations, and write back the configuration file. ConfXML allows the coder to work on the semantic meaning of the configuration file, instead of fighting with syntax.
For the most common configuration files (/etc/passwd, /etc/samba/smb.conf ...), Conf2XML has a database that links the configuration filename to the matching template and options. So very little work is needed to use the API with common configuration files. For other kind of configuration files, one need to specify the template (here is the list), and if needed, some additional options.