[NTG-context] XML: calculations on attribute values before output

Duncan Hothersall dh at capdm.com
Wed May 4 22:10:07 CEST 2022


I'm processing an XML table and need to set a row span. Because we use a
variant of the CALS table model, spans are defined by an attribute saying
how many *additional* rows should be spanned, as opposed to how many *in
total*. So to translate this into TABLE \bTD[nr=X] syntax I need to add 1.

I'm guessing this is very easily doable (in lua?) but I've tried various
permutations and can't work it out. If anyone could give me a pointer that
would be great.

(In reality I'm going to need to handle lots of other conversions of
attribute values into \bTD[...] commands, so if there's a generalised way
of doing that sort of thing, or even better if someone has already tackled
CALS tables in this way, that would also be great!)

MWE below, but obviously it just passes the morerows="1" value straight
through into \bTD[nr=1] so it doesn't give me a row span at all.

Thanks in advance.



    <entry morerows="1">1</entry>

\startxmlsetups xml:demo:base


\startxmlsetups xml:demo:informaltable

\startxmlsetups xml:demo:tgroup

\startxmlsetups xml:demo:tbody

\startxmlsetups xml:demo:row

\startxmlsetups xml:demo:entry


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220504/5ac7d2c0/attachment.htm>

More information about the ntg-context mailing list