At 08:06 PM 10/8/2001 +0200, Berend de Boer wrote:

>Good. Especially \starttabulate is a bit finicky. Works with a well
>defined \defineXMLnested, but it's a bit unclear what's going on.

tabulate and table do several passes and collect into, which means that 
when used in xml mapping commands, you have to expand the content to be 
sure that it ends up in the internal data structures

%D \starttypen
%D <tabulate>
%D   <tspec>
%D     <tcell align="left"/> <tcell align="middle"/> <tcell align="right"/>
%D   </tspec>
%D   <thead>
%D     <trule/>
%D     <tr> <td> bagger </td> <td> bagger </td> <td> bagger </td> </tr>
%D     <trule/>
%D   </thead>
%D   <ttail>
%D     <trule/>
%D   </ttail>
%D   <tbody>
%D     <tr> <td> bagger </td> <td> bagger </td> <td> bagger </td> </tr>
%D     <tr> <td> bagg   </td> <td> ger    </td> <td> gr     </td> </tr>
%D     <tr> <td> bag    </td> <td> er     </td> <td> gger   </td> </tr>
%D   </tbody>
%D </tabulate>
%D \stoptypen
\newtoks\XMLtabtoks

\defineXMLenvironment [context:tabulate]
   {\bgroup
    \XMLerase{context:thead}%
    \XMLerase{context:ttail}%
    \XMLtabtoks{|l|p|}}
   {\egroup}

\defineXMLpickup [context:tbody]
   {\expanded{\definetabulate[dummy][\the\XMLtabtoks]}
    \startdummy\XMLpop{context:thead}}
   {\XMLpop{context:ttail}\stopdummy}

\defineXMLpush [context:thead]
\defineXMLpush [context:ttail]

\defineXMLenvironment[context:tspec]
   {\XMLtabtoks\emptytoks}
   {\appendtoks|\to\XMLtabtoks}

\defineXMLsingular [context:trule] % verrrry ugly
   {\crcr\noalign{\kern-\lineheight}\HL}

\defineXMLsingular [context:tcell] [align=]
   {\appendtoks|\to\XMLtabtoks
    \ExpandFirstAfter\processaction
      [\XMLpar{context:tcell}{align}{}]
      [  left=>\appendtoks l\to\XMLtabtoks,
        right=>\appendtoks r\to\XMLtabtoks,
       center=>\appendtoks c\to\XMLtabtoks,
       middle=>\appendtoks c\to\XMLtabtoks]}

\defineXMLenvironment [context:tr] {\ignorespaces} {\NC\NR}
\defineXMLenvironment [context:td] {\NC}           {\ignorespaces}

now, is this crappy or not ?

>Hmm, XML schema's are way to difficult. Have you looked at RELAX NG?

as is xslt -)

>         http://www.oasis-open.org/committees/relax-ng/

no, yet another "standard"?

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | [EMAIL PROTECTED]
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------

Reply via email to