[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] config file formats



On 2012-12-03 14:05:49 +0700, Ivan Shmakov wrote:
> 	On the second sight, the difference between, e. g.:
> 
> <a>
>   <b>
>     <c>d</c>
>     <e>f</e>
>   </b>
>   <g>
>     <h>i</h>
>   </g>
> </a>
> 
> 	and, e. g.:
> 
> [a.b]
> c = d
> e = f
> [a.g]
> h = i
> 
> 	is mostly superficial.

There may be a difference at the API level, say if you want all
the descendants of a.

And things get more complex with:

<a condition="some regexp">
  ...
</a>
<a condition="some other regexp">
  ...
</a>

(possibly with nested a's). Of course, you can always find a way to
write that with the ini format, say

[a1]
condition = some regexp
...
[a2]
condition = some other regexp
...

but you are completely hiding the underlying structure. This makes
the file harder to understand and harder to validate (against a
schema based on the tree structure).

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: