[NTG-context] xmlpos values doubled

Ben Moon ben at themoons.uk
Mon Mar 28 11:44:16 CEST 2022

Hello All,

I'm trying to render a table stored in XML JATS format (https://jats.nlm.nih.gov/archiving/) and eventually want to use the <colgroup> tag to setup column aligning from the @align attribute, e.g.,

    \setupTABLE [column] [\xmlpos{#1}] [align=\xmlatt{#1}{align}]

Including \xmlpos{#1} I get double the value returned, i.e.: the first element in colgroup returns 2, the second returns 4 etc.

Below is a MWE to show my issue. I show \xmlpos for each <col> tag in <colgroup>  above the table, which returns 2, 4, 6, 8 but I expected 1, 2, 3, 4. Am I missing something or is there another way I could do this?

        <col align="center" />
        <col align="right" />
        <col />
        <col />
          <th>H1 (centre)</th>
          <th>H2 (right)</th>

\startxmlsetups xml:tabletestsetups
    % tables


\startxmlsetups xml:table-wrap
        % \contextversion \par

\startxmlsetups xml:table

\startxmlsetups xml:colgroup

\startxmlsetups xml:col
    \xmlpos{#1} \xmlatt{#1}{align}\par

\startxmlsetups xml:table:thead

\startxmlsetups xml:table:tr

\startxmlsetups xml:table:th

\startxmlsetups xml:table:tbody

\startxmlsetups xml:table:td


All the best,

Ben Moon
ben at themoons.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220328/ff1f9be7/attachment.htm>

More information about the ntg-context mailing list