R – Convert configuration files to XML


We have a large number of legacy configuration files, of various formats normally something like KEYWORD DATA KEYWORD DATA KEYWORD DATA.

The the format of the data itself is unique within each configuration file.

What we would like to do is define the file data formats in some way and then use that to allow a application to check a the configuration files against to defined file formats.

We have thought about defining them as BNF and using YACC or its equivalent, but the nagging feeling is that there must be a away of doing this using XML.

What would be required was a way of defining a configuration files data format preferable in a XML format, then use that file to convert the legacy file into valid XML. Preferable a way of converting the XML file back to the legacy file format would be useful.

Best Solution

For the convertion XML->legacy file, XSLT would probably work fine.