The "classic" approach I know to store some configuration information in an XML file looks basically like this:
<properties>
<entry key="hello">Hello</entry>
<entry key="world">world</entry>
</properties>
or maybe this:
<properties>
<entry key="hello" value="Hello"/>
<entry key="world" value="World"/>
</properties>
We're currently trying to come up with a simple and flexible configuration file for internal use that will be read by several scripting languages as well as possibly some C# and C++.
I'm wondering whether the above approach is the "way to go", or whether an approach with "ad hoc" elements would yield a file that is more straightforward to extract information from:
<properties>
<hello>Hello</hello>
<world>World</hello>
</properties>
Certainly, any XPath expressions would get shorter, e.g.:
"//properties/hello"
vs.
"//properties/entry[@key='hello']/@value
This would make scripts that quickly grab some info out of the file easier to read I think.
What pro/con would these forms have wrt. easily and succinctly grabbing values out of it? (vs. maintainability, ...)
I'm not overly concerned with a schema for this, and please lets not get into XML for configuration files, why? .