[Zope3-dev] Relax NG schema and some statistics

Martijn Faassen faassen at vet.uu.nl
Wed Aug 27 20:44:36 EDT 2003


Hi there,

I just checked in a Relax NG schema for ZCML. It can use lots
more work but it does validate all ZCML in the Zope 3 tree at
present, excepting zope.app.configure test files. Note that the
schema is based on actual use, not on the source code, so I
am likely missing some attributes or even directives as they were
never exercised or never present in particular combinations.

Some interesting statistics from it:

ZCML currently has 18 namespaces for directives (all start with 
http://namespaces.zope.org/):

zope, browser, gts, event, help, ffsync, meta, server-control, tales,
xmlrpc, rdb, dav, workflow, mail, xml, startup, code, renderer.

Some namespaces contain many directives, such as zope and browser. Others
are pretty simple and are only used in a few places.

The zope namespace contains a whopping 21 directives. browser comes second
with 12 different directives. All the other namespaces contain 1 or
2 directives (in active use), except for mail. 'meta' sports a
number of subdirectives making it more complex as well.

While some directives are simple, quite a few directives have 5 or more
attributes, frequently with a number of them optional.

The champion here is addform, which has 4 required attributes
(name, schema, permission, content_factory) and 11 optional ones
(menu, for, arguments, keyword_arguments, fields, class, label, title,
set_before_add, set_after_add, description).

Next steps will be to refactor the Relax NG schema making it more
compact by reusing more information as well as more modular.

We can also start philosophising on what this information implies,
if anything, and whether we can improve ZCML to make it more
readable/learnable as well as allowing minimal ways to override
particular directives.

Regards,

Martijn




More information about the Zope3-dev mailing list