On 1/19/2014 11:53 AM, Kate F wrote:
Hi,
I'm trying to glue MkIV XML handling to ConTeXt's tabulation. My markup has a HTML-style table model, with an arbitary number of <col> elements.
My problem is to produce the |c|c|c|c| format based on the number of <col> elements I have, rather than hardcoding a specific number of columns.
I thought I could do something like this, but unfortunately the string produced by \xmlconcat{#1}{col}{\|} seems to be ignored:
% in practice this would produce various alignments, not just "c" \startxmlsetups xml:col c \stopxmlsetups
\startxmlsetups xml:table \starttabulate[\|\xmlconcat{#1}{col}{\|}\|] \xmlall{#1}{thead|tbody} \stoptabulate \stopxmlsetups
Whereas this works fine, as I'd expect: \starttabulate[|c|c|c|c|]
(I'm also confused about the escaping for \| there. I guess the [] is a special environment, with | being given a different catcode, perhaps?)
Is there a way to do this, with the number of columns and their alignment generated from the input XML?
\usmeodule[cals] also see the test suite mkiv/xml/tables* etc ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------