![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
At 03:35 PM 2/10/2003 +0100, varheit@gmx.de wrote:
Dear all,
I would like to use the combination feature from an XML source.
My XML environment file includes the following definitions:
\defineXMLenvironment[combination]
{\expanded{\startcombination[\XMLpar{combination}{layout}{2}*\XMLpar{combination}{rows}{1}]}} {\stopcombination}
\defineXMLpickup[combinationentry] {\defineXMLpush[combinationitem]\defineXMLpush[combinationcaption]}
{\expanded{\bgroup\XMLpop{combinationitem}\egroup\bgroup\XMLpop{combinationcaption}\egroup}}
The XML source that I use looks like this:
<combination columns="2" rows="1"> <combinationentry> <combinationitem>Image A</combinationitem> <combinationcaption>Caption for image A</combinationcaption> </combinationentry> <combinationentry> <combinationitem>Image B</combinationitem> <combinationcaption>Caption for image B</combinationcaption> </combinationentry> </combination>
ah, real trickery is needed here: \defineXMLenvironment [combination] [columns=2,rows=1] {\scratchtoks\emptytoks \expanded{\appendtoks \noexpand \startcombination [\XMLop{columns}*\XMLop{rows}]}\to \scratchtoks} {\appendtoks \stopcombination \to \scratchtoks \the\scratchtoks} \defineXMLprocess[combinationentry] \defineXMLpickup [combinationitem] {\appendtoks\bgroup}{\egroup\to\scratchtoks} \defineXMLpickup [combinationcaption] {\appendtoks\bgroup}{\egroup\to\scratchtoks} I can add such thing to x-contml.tex if needed Hans ------------------------------------------------------------------------- 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 ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------