From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/6886 Path: main.gmane.org!not-for-mail From: Simon Pepping Newsgroups: gmane.comp.tex.context Subject: Re: DocBook probleempje Date: Mon, 11 Feb 2002 22:15:47 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <20020211221547.A14372@scaprea> References: <20020208220553.B384@scaprea> <5.1.0.14.1.20020210215623.02f99fc8@server-1> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035397391 14728 80.91.224.250 (23 Oct 2002 18:23:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:23:11 +0000 (UTC) Original-To: ntg-context@ntg.nl In-Reply-To: <5.1.0.14.1.20020210215623.02f99fc8@server-1>; from pragma@wxs.nl on Sun, Feb 10, 2002 at 10:04:15PM +0100 Xref: main.gmane.org gmane.comp.tex.context:6886 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:6886 On Sun, Feb 10, 2002 at 10:04:15PM +0100, Hans Hagen wrote: First the problem in English: I want to render the revhistory as a table. But it may have a large range of fields. Preferably I would like to be able to see which fields occur, and only include those columns. This code works fine, and it teaches me that it is not necessary to write to an auxiliary file. All data can be built in memory. But I want more. The following is an appropriate test text. Each row may show a different selection from the possible fields. And all rows together may only use a subset of the set of possible fields. I only want to include the fields actually used; so I do not want to show the field authorinitials if that is not used in any of the rows. 0.06 2001-01-08 gjf Changed date format (YYYY-MM-DD) 0.07 2001-01-09 Changed date format (YYYY-MM-DD) again 0.08 gjf Changed date format (YYYY-MM-DD) once more > 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 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} > Regards, Simon -- Simon Pepping email: spepping@scaprea.hobby.nl