================
ZCML in Relax NG
================

:author:  Martijn Faassen

zcml.rng is a Relax NG schema that can validate (at the time of
writing) all the .zcml files in the Zope 3 core source tree.  The only
exception to this is in zope/app/configure. There are tests there
which test zcml and make different assumptions than the schema do.

The schema is based on actual usage of ZCML. The code may actually
define directives and optional attributes that are never ever used or
tested. They are not part of the schema.

The schema is not finished yet. It can be tightened further and it can
be refactored to reuse more common information; many directives share
some attributes. It can also be made more modular by splitting up the
different namespaces into separate files.

You should be able to validate a ZCML file against the schema by using
any Relax NG processor.  I've used libxml2's implementation through
xmlllint, using the following command::

  xmllint --noout --relaxng zcml.rng somefile.zcml

At the time of writing the most recent release of libxml (2.5.10)
contains a bug which causes a segfault under certain circumstances. A
recent CVS checkout of libxml2 has a fix.
