httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David D'Antonio" <>
Subject RE: XML configuration (was Re: environment patch)
Date Fri, 09 Jul 1999 22:34:25 GMT
> -----Original Message-----
> From: []On
> Behalf Of Greg Stein
> Sent: Friday, July 09, 1999 4:46 PM
> To:
> Subject: XML configuration (was Re: environment patch)
> Ben Laurie wrote:
> > 
> > Greg Stein wrote:
> > > For example, let's say that we have the following XML config:
> > >
> > > <alias>
> > >   <location>/gstein</location>
> > >   <directory>/home/gstein/htdocs</directory>
> > > </alias>
> >...
> > Not sure I want to get into an XML details argument, but I'd've expected
> Argument? hehe... I think we're still at the discussion stage. Wait
> until somebody actually starts coding a particular direction that
> another person doesn't like. *Then* we'll get to the argument stage :-)

> > this to look like:
> > 
> > <alias location="/gstein" directory="/home/gstein/htdocs</directory"/>
> > 
> > Is there some reason it shouldn't be like this?
> Using elements is more flexible. For example, the attribute based
> version cannot do this:
> <directory>
>   /home/gstein/htdocs
>   <nfs>
> </directory>
> In this case, I've let Apache know that the directory is on an NFS
> mount. It can alter its behavior to take special advantage of the NFS
> mount (or *not* do things which work worse on NFS mounts).

Wouldn't this do the same?

<directory type="nfs">

> I might also want to do this:
> <alias>
>   <location>/gstein</location>
>   <location>/backwards/compat/location</location>
>   <directory>/home/gstein/htdocs</directory>
> </alias>
> Any attribute-based schema can be translated to an element-based schema.
> Exercise for the reader.

And visa versa?

> An external tool can easily deal with either form: element- or
> attribute- based. Because of this, I'd recommend element-based for its
> flexibility.

I personally think some things should be attributes and some things should be
elements. In the example above, NFS is an attribute of the directory. Also,
attributes seem appropriate when choosing from a list (i.e. a directory can be
one of NFS, LOCAL, SMB, CD, etc).

> DTD are for wussies.

> Personally, I'd prefer to have the speed of a non-conforming parser
> since the modules are implicitly going to be doing the validation. It
> also means that we don't have to teach XML DTD construction to module
> authors. They can simply monkey-see, monkey-do on the value fetching and
> skip DTD construction (yes, they could probably do this with a DTD, too,
> but that is parallel maintenance in my mind).

But having a DTD and a vaildating parser is kind of nice so that module
users can get some help if their XML doesn't work properly. Are there tools
that can generate a DTD from some "conforming" XML?

> Greg Stein,


David D'Antonio CNE -
 Some they do and some they don't and some ya just can't tell
  Some they will and some they won't and some it's just as well

View raw message