%D \module
%D   [       file=x-cals,
%D        version=2007.09.05,
%D          title=\CONTEXT\ XML Modules,
%D       subtitle=Cals table renderer,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{ConTeXt XML Macros / Cals Tables}

\startmodule [cals]

\registerctxluafile{x-cals}{}

% \startxmlsetups xml:cals:process
%     \xmlsetsetup {#1} {cals:table} {*}
% \stopxmlsetups
% \startxmlsetups cals:table
%     \ctxlua{moduledata.cals.table("#1")}
% \stopxmlsetups
% \xmlregistersetup{xml:cals:process}

\startxmlsetups xml:cals:process
%     \xmlsetfunction {\xmldocument} {cals:table} {moduledata.cals.table}
    \xmlsetfunction {#1} {cals:table} {moduledata.cals.table}
\stopxmlsetups

\startxmlsetups xml:cals:nonamespace
%     \xmlsetfunction {\xmldocument} {table} {moduledata.cals.table}
    \xmlsetfunction {#1} {table} {moduledata.cals.table}
\stopxmlsetups

\xmlregistersetup{xml:cals:process}

\xmlregisterns{cals}{cals}

%D One can register the nonamespace variant for cases where the cals
%D model is embedded in the parent DTD.

\stopmodule
