File Format Design for Meta Data and Contents
I am currently in duty to design a file format which carries both meta information as well as actual contents.
The meta information part mainly consists of the following attributes (may be extended):
1) Function Name
2) Function Arguments
The content part is of tabular structure and consists of column header and actual content rows. Both the header definition as well as the contents is all custom and the file format should be flexible enough to support this.
Example for some content:
id name adresse
1 miller somewhere
2 john anywhere
Note: The aim of such a file format is to define a function to be called with the provided tabular contents.
Is an XML format feasible to implement such requirements for meta and actual data contents as described above?
Or is there anyone that knows of a best practise for such requirements?
I want to avoid re-inventing the wheel...
Thank you and Kind Regards,
Re: File Format Design for Meta Data and Contents
Personally, I've found XML to usually be the best course of action. In my experience, it provides a flexible solution where I can add/remove parts of the document format with minimal code change. It also allows good flexibility for "optional" fields, which is always a plus. Lastly, XML reading and writing is included in the standard java api, so you don't "have" to add any additional dependencies to your project (although there are some significantly better XML reading/writing apis than the standard java api one).