From: Hans Hagen <pragma@wxs.nl>
Cc: ntg-context@ntg.nl
Subject: Re: DocBook probleempje
Date: Sun, 10 Feb 2002 22:04:15 +0100 [thread overview]
Message-ID: <5.1.0.14.1.20020210215623.02f99fc8@server-1> (raw)
In-Reply-To: <20020208220553.B384@scaprea>
Hi Simon,
Your problem can be solved in the following way: [i cc to teh list since it
may be instructive]
% output=pdftex
% This is the first pass: add an \bTD .. \eTD (or \bTH .. eTH) entry
\def\WhatAHackA#1%
{\defineXMLenvironmentsave[#1]
{\bTD#1\eTD\defineXMLignore[#1]}
\donothing}
% and this the second pass: actually typeset them
\def\WhatAHackB#1%
{\defineXMLpickup[#1]
\bTD
\eTD}
% here we do the two passes (one can add an additional pass
% over the <revision> element, or even better: store the
% entries, and flush them when needed skipping empty elements)
\defineXMLenvironmentsave[revhistory]
{\bgroup}
{\def\HackList{revnumber,date,revremark,authorinitials}
\defineXMLenvironment[revision] \donothing \donothing
\processcommacommand[\HackList]\WhatAHackA
\bTABLE
\bTR\XMLflush{revhistory}\eTR
\defineXMLpickup[revision] \bTR \eTR
\processcommacommand[\HackList]\WhatAHackB
\XMLflush{revhistory}
\eTABLE
\egroup}
% one could of course just name the \define...'s instead of a list, but the
list is better when there are 100 possible entries
%
% \defineXMLenvironmentsave[revnumber]....
% \defineXMLenvironmentsave[...]
btw, a not yet finished but handy option is tex namespaces, which permits
you to define element handlers at the outer level and swicht to a namespace
when flushing a saved element;
i also have a system for building elements in mem, but yet unfinished
% The example:
\starttext
\startXMLdata
<revhistory>
<revision>
<revnumber>0.06</revnumber>
<date>2001-01-08</date>
<authorinitials>gjf</authorinitials>
<revremark>
Changed date format (YYYY-MM-DD)
</revremark>
</revision>
</revhistory>
\stopXMLdata
\startXMLdata
<revhistory>
<revision>
<revnumber>0.06</revnumber>
<date>2001-01-08</date>
<revremark>
Changed date format (YYYY-MM-DD)
</revremark>
</revision>
</revhistory>
\stopXMLdata
\stoptext
At 10:05 PM 2/8/2002 +0100, you wrote:
>Hans,
>
>Hier nog een probleempje. De revhistory wil ik graag als een tabel
>weergeven. Maar er kunnen een groot aantal velden in voorkomen. Het
>liefst zou ik eerst kunnen kijken welke velden er voorkomen, en alleen
>die kolommen in de tabel opnemen. Dat is geen eenvoudige zaak, en
>vereist zeker meer dan één gang over de TeX file. Heb jij daar ideeen
>over?
>
><revhistory>
> <revision>
> <revnumber>0.06</revnumber>
> <date>2001-01-08</date>
> <authorinitials>gjf</authorinitials>
> <revremark>
> Changed date format (YYYY-MM-DD)
> </revremark>
> </revision>
>
> <!-- Additional (*earlier*) revision histories go here -->
></revhistory>
>
>% revision history
>% I would like to modify the layout
>% it would be nice if we could inspect the table first;
>% not all columns need to be present
>\defineXMLenvironment[revhistory]
> {\blank[medium]\bgroup\switchtobodyfont[small]
> \midaligned{Revision History}
> \midaligned\bgroup\bTABLE
> % column headers
> \bTR \bTD \bf Revision\eTD \bTD \bf Date\eTD \bTD \bf Remarks\eTD
> \eTR
> }
> {\eTABLE
> \egroup % end midaligned
> \egroup % end switchtobodyfont
> }
>\defineXMLpickup[revision] \bTR \eTR
>\defineXMLpickup[revnumber] \bTD \eTD
>\defineXMLpickup[date] \bTD \eTD
>\defineXMLpickup[revremark] \bTD \eTD
>
>Zoals het kommentaar al aangeeft heb ik ook geen goede dokumentatie
>kunnen vinden voor de \bTABLE ... \eTABLE konstruktie.
>
>Groeten, Simon
>
>--
>Simon Pepping
>email: spepping@scaprea.hobby.nl
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | pragma@wxs.nl
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
-------------------------------------------------------------------------
fall-back web server:
www.pragma-pod.nl
-------------------------------------------------------------------------
next parent reply other threads:[~2002-02-10 21:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20020208220553.B384@scaprea>
2002-02-10 21:04 ` Hans Hagen [this message]
2002-02-11 21:15 ` Simon Pepping
2002-02-13 20:15 ` Hans Hagen
2002-02-14 22:13 ` Simon Pepping
2002-02-15 7:46 ` Hans Hagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5.1.0.14.1.20020210215623.02f99fc8@server-1 \
--to=pragma@wxs.nl \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).