Craig, yes, that's exactly the problem. Valve is another prominent case
where the attribute-checking is not possible.

One solution, but I confess that I would not recommend it, is to distinguish
between the different types, i.e. change <Valve> to
<AccessLogValve>,<RequestDumperValve>,<RemoteHostFilter> etc. That would
certainly make the server.xml validatable, but create the burden of changing
the xsd/dtd every times a user creates her own Valve/Logger/Realm etc.

Could xslt be a solution to check the required attributes if the dtd/schema
uses union? Maybe that is to much effort because anyway if a required
attribute is not present, the digester would moan.

Mika

----- Original Message -----
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: "Tomcat Developers List" <[EMAIL PROTECTED]>
Sent: Friday, November 30, 2001 4:09 AM
Subject: Re: server.xml DTD/Schema


> One thing to remember is that it is not technically possible to write a
> DTD for server.xml that covers all possible cases (and I suspect that's
> true for Schema as well).  Consider the following cases:
>
> * Elements like <Logger> and <Realm> let you define which implementation
>   class you want, from the set of choices included with Tomcat.  The set
>   of attributes that are valid depends on which implementation class you
>   choose -- and there is no way to make that distinction in a DTD.  The
>   best you could do is list the union of all possible attributes -- but
>   that is not semantically valid for any single implementation.
>
> * Even more generally, Tomcat users are free to install their own
>   implementations of Tomcat classes, and there's no way your general
>   purpose DTD would know which attributes are valid.
>
> Craig McClanahan
>
>
>
> On Fri, 30 Nov 2001, Mika Goeckel wrote:
>
> > Date: Fri, 30 Nov 2001 01:01:46 +0100
> > From: Mika Goeckel <[EMAIL PROTECTED]>
> > Reply-To: Tomcat Developers List <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: server.xml DTD/Schema
> >
> > Hi,
> >
> > I've built a first version of a DTD/Schema for server.xml and would ask
if
> > someone would like to review it?
> >
> > I would prefer the Schema, because it allows more checking, but I
haven't
> > seen a parser which checks against schemes, so I created a DTD from it
as
> > well.
> >
> > As this is quite a bunch of lines, please hands up who wants to receive
it.
> >
> > Cheers, Mika
> >
> > P.S.: The initial cut is from the docu, I plan to go through the source
> > tomorrow to recheck.
> >
> >
> > --
> > To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to