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

Re: Using XML to handle all configuration files



>>>>> "Evan" == Evan Prodromou <evan@prodromou.san-francisco.ca.us> writes:

>>>>> "D" == D-Man  <dsh8290@rit.edu> writes:
    D> I think that XML config format would be cool for 2 (main)
    D> reasons:

    Evan> I for one think that XML is unnecessary. All configuration
    Evan> files should be stored as s-expressions instead. Easy to
    Evan> parse, easy to write!

(not sure if you are serious or not here...)

You can't validate s-expressions with DTD, XML-schema or whatever.

Also, I think s-expressions make it difficult to match the correct
right ) with the left (. Sure, a good editor can help, but I prefer
just being able to tell at a quick glance, using less, for instance.

For instance compare

<interfaces>
<comment>This is a comment</comment>
<auto>lo</auto>
<auto>inet</auto>
<auto>loopback</auto>

<iface name="lo" family="inet" method="loopback"/>

<iface name="eth0" family="inet" method="static">
	<address>10.1.2.2</address>
	<network>10.1.0.0</network>
	<netmask>255.255.0.0</netmask>
	<broadcast>10.1.255.255</broadcast>
	<gateway>10.1.2.254</gateway>
</iface>

</interfaces>

with

(interfaces
(comment "This is a comment")
(auto lo)
(auto inet)
(auto loopback)

(iface lo inet loopback)

(iface eth0 inet static
	(address 10.1.2.2)
	(network 10.1.0.0)
	(netmask 255.255.0.0)
	(broadcast 10.1.255.255)
	(gateway 10.1.2.254)))
)

and tell me in 10 seconds or less if the S expression is valid or
what errors exist if it is not...
-- 
Brian May <bam@debian.org>



Reply to: