XML use (was: Re: Brainstorm: <stage>)

Mark Ellis mark.uzumati at virgin.net
Wed Apr 3 04:19:38 PST 2002


On 2002.04.02 22:44 Loïc Péron wrote:
> Quoting alfs-discuss at linuxfromscratch.org:
> > alfs-discuss Digest	Mon, 01 Apr 2002	Volume: 03
> Issue: 062
> 
> Hi,
> 
> I just read all of the discussions that took place last week,
> and I have some remarks:
> 
> > Date: Mon, 1 Apr 2002 22:57:19 +0100
> > From: Mark Ellis <mark.uzumati at virgin.net>
> > Subject: Re: Brainstorm: <stage>
> >
> > On 2002.04.01 10:11 Neven Has wrote:
> > > I like the idea of creating a new environment (so there is no need
> > > that
> > > the user previously unsets all not needed variables). Which
> together
> > > would give us something like:
> > >
> > >     <environment mode="set|add">
> > >         <variable mode="append" name="" value="" />
> > >     </environment>
> > >
> > > Although, I think that:
> > >
> > >     <environment mode="add">
> > >         <variable>
> > > 		<name>HOME</name>
> > > 		<value>/root</value>
> > > 	</variable>
> > >
> > >         <variable mode="append">
> > > 		<name>PATH</name>
> > > 		<value>/static/bin:/static/usr/bin</value>
> > > 	</variable>
> > >     </environment>
> > >
> > > would be more clearer/structured/more XML-like/whatever... ?
> > >
> > > In the past we were so desperately trying to run away from the
> > > amount of attributes there were in the syntax
> 
> May I ask why? (seems I was not around at that time)
> 

A number of reasons, if you really want the full grisly story :) take a 
look at the archives.

> > I like the element structure rather than the attributes too, though
> in
> > this case we could probably go with either, its a "look and feel"
> > thing.
> 
> I don't think it's just a "look and feel" thing:
> AFAIK, elements, attributes and content have different
> particularities:
> (not including rules forced by a DTD)
> 

<snip>

Some valid points here, particularly with stuff like multiple 
occurences, enforced ordering, but if you take a look at a good book on 
XML it will almost certainly mention the element vs. attribute 'holy 
war'. Both sides have come up with some very good arguments, but 
basically they each just like their own way best, nothing wrong with 
that.

> Following those principles, most of what is actually contained in
> elements should be in attributes:
> . all path and path-like values
> . all boolean values
> . all command-line parameters
> . all short strings (package name, version, ...)
> 

Take a look at the old syntax, everything was attributes, looked 
absolutely awful, one of the reasons it changed.

> I re-suggest you to have a look at ANT, and particuliarly at it's
> syntax:
> http://jakarta.apache.org/ant/manual/index.html sections entitled
> "Using
> ANT" and "Built-in tasks".
> 

On a number of peoples todo, one day someone might even get around to 
it.

Mark
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe alfs-discuss' in the subject header of the message



More information about the alfs-discuss mailing list