%D \module
%D   [       file=m-steps,
%D        version=2001.05.28,
%D          title=\CONTEXT\ Modules,
%D       subtitle=Step Charts \& Tables,
%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.

%D The \XML\ interface. This module can be made way more efficient
%D in \MKIV\ using textext but it makes only sense to do this when
%D I really need it in a demanding application. Probably half of the
%D code in m-steps.tex can go.

\usemodule[m][steps]

\endinput

\unprotect

\installcorenamespace {xmlstepchart}
\installcorenamespace {xmlsteptable}

\def\xmlstepchartdirective#1{\executeifdefined{\??xmlstepchart#1}\gobbletwoarguments} % {#2}{#3}
\def\xmlsteptabledirective#1{\executeifdefined{\??xmlsteptable#1}\gobbletwoarguments} % {#2}{#3}

\setvalue{\??xmlstepchart charts}{\setsomevalue\@@STPC}
\setvalue{\??xmlstepchart  cells}{\setsomevalue\@@STEC}
\setvalue{\??xmlstepchart  texts}{\setsomevalue\@@STET}
\setvalue{\??xmlstepchart  lines}{\setsomevalue\@@STEL}

\setvalue{\??xmlsteptable tables}{\setsomevalue\@@STPT}
\setvalue{\??xmlsteptable  cells}{\setsomevalue\@@STEC}
\setvalue{\??xmlsteptable  texts}{\setsomevalue\@@STET}
\setvalue{\??xmlsteptable  lines}{\setsomevalue\@@STEL}

\startxmlsetups xml:ct:define
    \xmlsetsetup {#1} {ct:*} {xml:ct:*}
  % \xmlsetsetup {#1} {ct:stepaligntable/cells} {xml:ct:stepaligntable:cells}
  % \xmlsetsetup {#1} {ct:stepaligntable/lines} {xml:ct:stepaligntable:lines}
\stopxmlsetups

\xmlregisterns{ct}{stepcharts}

\xmlregistersetup{xml:ct:define}

% \startxmlsetups xml:ct:prep
%     \normalexpanded{\prep[\xmltoparameters{#1}]}{\xmlflush{#1}}
% \stopxmlsetups

\startxmlsetups xml:ct:text
    \normalexpanded{\text[\xmltoparameters{#1}]}{\xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:ct:texts
    \normalexpanded{\texts[\xmltoparameters{#1}]}{\xmltext{#1}{/top}} {\xmltext{#1}{/bot}}
\stopxmlsetups

\startxmlsetups xml:ct:cell
    \normalexpanded{\cell[\xmltoparameters{#1}]}{\xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:ct:cells
    \normalexpanded{\cells[\xmltoparameters{#1}]}{\xmltext{#1}{/top}} {\xmltext{#1}{/bot}}
\stopxmlsetups

\startxmlsetups xml:ct:lines
    \normalexpanded{\startlines[\xmltoparameters{#1}]}
        \xmlflush{#1}
    \stoplines
\stopxmlsetups

\startxmlsetups xml:ct:steptable
    \normalexpanded{\startSTEPtable[\xmltoparameters{#1}]}
        \xmlflush{#1}
    \stopSTEPtable
\stopxmlsetups

\startxmlsetups xml:ct:stepchart
    \normalexpanded{\startSTEPchart[\xmltoparameters{#1}]}
        \xmlflush{#1}
    \stopSTEPchart
\stopxmlsetups

% \startxmlsetups xml:ct:stepaligntable
%     \expanded{\startSTEPaligntable[\xmltoparameters{#1}]}
%         \xmlflush{#1}
%     \stopSTEPaligntable
% \stopxmlsetups
%
% \startxmlsetups xml:ct:stepaligntable:cells
%     \expanded{\cells[\xmltoparameters{#1}]} {\xmltext{#1}{/ct:c1}} {\xmltext{#1}{/ct:c2}} {\xmltext{#1}{/ct:c3}}
% \stopxmlsetups
%
% \startxmlsetups xml:ct:stepaligntable:lines
%     \expanded{\setupSTEPlines[\xmltoparameters{#1}]}
%     \xmlflush{#1}
% \stopxmlsetups

\protect \endinput
