commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <craig...@apache.org>
Subject Re: [chain] DTD/XSD of config-chain.xml
Date Mon, 19 Dec 2005 17:41:04 GMT
On 12/19/05, Rahul Akolkar <rahul.akolkar@gmail.com> wrote:
>
> On 12/18/05, Wendy Smoak <wsmoak@gmail.com> wrote:
> <snip/>
> >
> > Any thoughts on the use of <catalog> as the root element vs. <chains>
> > as shown in the cookbook examples?
> >
> > Using <catalog> puts the commands into the default catalog which is
> > retrieved with CatalogFactory.getInstance().getCatalog().
> >
> > Using <chains> seems to do something else.  I haven't figured out if
> > the commands are going somewhere else, if the config file just isn't
> > being parsed, (or if I'm imagining it.)
> <snap/>
>
> As Craig mentions, its in fact better to have <catalogs> (or <foo>,
> but thats not readable) as the root since that allows placing more
> than one <catalog> elements in the chain config. Sorry, I'm not sure
> what <chains> is all about,


AFAIK it has no semantic meaning at all ... just an outer container for
multiple commands or chains defined inside.

I'll have to take one more look at the
> cookbook later. But looking at the trunk I can tell you the only
> elements of any semantic significance are <catalog>, <chain>,
> <command> and <define> (by default, though <define> could add others
> -- and it might even be possible to redefine <command>, which I
> believe is part of the "insanity" that was refered to ;-).
>
> The absence of a DTD and validating digester can indeed cause "silent
> failures" where the *intent* of the author goes unnoticed.
>
> Going back to the question asked, is there anything that can be done
> to help WRT validation at authoring time for chain configs, short of
> having users understand the digester? What do folks think about
> providing a DTD for the defaults, maybe on the wiki? This can provide
> some "in-editor" validation for the default rule-set, and a user may
> enhance the DTD for their own custom rules if they see fit (while the
> digester will continue to not be validating).


If you added <catalogs> as an outer element, you could cover the elements
for <catalog>, <chain>, and <command>.  However, DTDs (or even schemas)
are
not capable of dealing with what <define> does, and that is darned handy for
reducing the amount of stuff you have to write when using a common command
over and over again.

>From a strategic perspective, I could see some educational benefit to this
... but it also seems likely that it would cause confusion since it wouldn't
be required (and you should *not* declare it in DOCTYPE declarations on your
config files, because it is not complete).

An alternative approach might be to provide a utility class that could
"pretty print" all of the configured catalogs and commands, so you can look
at the result and see if it's what you expected.


-Rahul
>
>
> > Thanks,
> > --
> > Wendy
> >


Craig


---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message