From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/114602 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ben Moon via ntg-context Newsgroups: gmane.comp.tex.context Subject: xmlpos values doubled Date: Mon, 28 Mar 2022 10:44:16 +0100 Message-ID: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1857779378812428868==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40674"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.5.0-alpha0-4911-g925b585eab-fm-20220323.003-g925b585e Cc: Ben Moon To: "Context Mailing List" Original-X-From: ntg-context-bounces@ntg.nl Mon Mar 28 11:51:29 2022 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nYm25-000AJD-Mi for gctc-ntg-context-518@m.gmane-mx.org; Mon, 28 Mar 2022 11:51:29 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id B2FF82A35B3; Mon, 28 Mar 2022 11:50:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uoAaMfaEmiXj; Mon, 28 Mar 2022 11:50:52 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 644162A35B0; Mon, 28 Mar 2022 11:50:52 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id BD9152A35AF for ; Mon, 28 Mar 2022 11:50:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2rpWqhRgrwnB for ; Mon, 28 Mar 2022 11:50:49 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=64.147.123.20; helo=wout4-smtp.messagingengine.com; envelope-from=ben@themoons.uk; receiver= X-Greylist: delayed 365 seconds by postgrey-1.36 at zapf.ntg.nl; Mon, 28 Mar 2022 11:50:49 CEST Original-Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 91D932A3562 for ; Mon, 28 Mar 2022 11:50:49 +0200 (CEST) Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 2D9C63200D98 for ; Mon, 28 Mar 2022 05:44:42 -0400 (EDT) Original-Received: from imap46 ([10.202.2.96]) by compute1.internal (MEProxy); Mon, 28 Mar 2022 05:44:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=themoons.uk; h= cc:content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm1; bh=7 KtJ4WNc/jvOuru9nh4b0DXUKapcxv7RjJLbRIrVoAc=; b=ll0p2KjlJpGI5mVwz J2Cx5yQuYoaSNBWFOSXOaWEEssaynAg0C+mGemnZjgHEvYNcXrgLr8jV7+EXJfdm jAaMi/iJloyY76IiIH4o/q40e5wFMD3dFN1hQl7Bnm7Xmc1G0EdrZevyYzpY4iSc 5iG17WnjZdzEiO0VcVqu1jfR46TM1p/GsXGuqAQWysB0flUr2l+2ClZk8W4I1FqM 17dB+nSncN7k5SuNBS3ypfTOTENlN0RqK+monILVMKB0zE1WlB4kAqgWtor1yqLu 6qo+V/vuRc/KIx+0+xGQ1soHEAxYXhtqIA5PmLxNMrdZYyVRbFbYtCSIaeipXz1v C4p6g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=7KtJ4WNc/jvOuru9nh4b0DXUKapcxv7RjJLbRIrVo Ac=; b=dP4gdawUhY3G1K6H1oaI58ITi/MFK6wvMWqT2V2dfrCK1XQ+5kesbf0np JyCMCR8CH1Ys1UpEEnpUPfRqGpAwn1zZ7YsghXtIzucw/6e3boqGMKoc21IQxgBw GYmLuKk+11Gz57pwoe0Ll4CPCb7/dL/sCVbjMALNUw2I6pxuxVa08Ya5VUTa91Lc B+MtHyxGUUyR4lCAiogP3EghuLSV7ePrnDoo+aV2ILTM4U+jbjjkSntq2Wv8PFYu 9lJLzxosrhPZqAPmpFqCfBFOyrYWr0AU0YLxpUzQjqLXRPMUh7BlFkHd6BSUYEU7 o83/hBBD7jz6br5UVF7zTYZXSpjxA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudehjedgudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdlqdeimdenucfjughrpefofg ggkfffhffvufgtsegrtderreerredtnecuhfhrohhmpedfuegvnhcuofhoohhnfdcuoegs vghnsehthhgvmhhoohhnshdruhhkqeenucggtffrrghtthgvrhhnpefhieeifeehieevke ekgeegjefgjedufedtfefhheekgefggedvteefieekjedufeenucffohhmrghinhepnhhi hhdrghhovhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpegsvghnsehthhgvmhhoohhnshdruhhk X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id DAD391EE007B; Mon, 28 Mar 2022 05:44:40 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:114602 Archived-At: --===============1857779378812428868== Content-Type: multipart/alternative; boundary=626503fa1b074fba98c8eb39ad1dee4a --626503fa1b074fba98c8eb39ad1dee4a Content-Type: text/plain 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 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 tag in 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? ~~~~~~~~~~~~ \startbuffer[table]
H1 (centre) H2 (right) H3 H4
A1 A2 A3 A4
B1 B2 B3 B4
\stopbuffer \startxmlsetups xml:tabletestsetups \xmlsetsetup{#1}{*}{-} % tables \xmlsetsetup{#1}{table-wrap|table}{xml:*} \xmlsetsetup{#1}{thead|tbody|tr|th|td}{xml:table:*} \xmlsetsetup{#1}{colgroup|col}{xml:*} \stopxmlsetups \xmlregistersetup{xml:tabletestsetups} \startxmlsetups xml:table-wrap \startplacetable % \contextversion \par \xmlflush{#1} \stopplacetable \stopxmlsetups \startxmlsetups xml:table \bTABLE \xmlflush{#1} \eTABLE \stopxmlsetups \startxmlsetups xml:colgroup \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:col \xmlpos{#1} \xmlatt{#1}{align}\par \stopxmlsetups \startxmlsetups xml:table:thead \bTABLEhead \xmlflush{#1} \eTABLEhead \stopxmlsetups \startxmlsetups xml:table:tr \bTR \xmlflush{#1} \eTR \stopxmlsetups \startxmlsetups xml:table:th \bTH \xmlflush{#1} \eTH \stopxmlsetups \startxmlsetups xml:table:tbody \bTABLEbody \xmlflush{#1} \eTABLEbody \stopxmlsetups \startxmlsetups xml:table:td \bTC \xmlflush{#1} \eTC \stopxmlsetups \xmlprocessbuffer{main}{table}{} ~~~~~~~~~~~~ All the best, Ben Ben Moon ben@themoons.uk --626503fa1b074fba98c8eb39ad1dee4a Content-Type: text/html Content-Transfer-Encoding: quoted-printable
Hello All,=

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

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

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

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

~~~~~~~~~~~~
\s= tartbuffer[table]
  <table-wrap>
=     <table>
    &= nbsp; <colgroup>
      = ;  <col align=3D"center" />
   &= nbsp;    <col align=3D"right" />
&nbs= p;       <col />
 = ;       <col />
 =      </colgroup>
  &nb= sp;   <thead>
    &nbs= p;   <tr>
     &n= bsp;    <th>H1 (centre)</th>
&n= bsp;         <th>H2 (right= )</th>
       &nb= sp;  <th>H3</th>
    =       <th>H4</th>
&nb= sp;       </tr>
 =      </thead>
   =    <tbody>
     &= nbsp;  <tr>
      = ;    <td>A1</td>
  &n= bsp;       <td>A2</td>
          <td>= A3</td>
       &n= bsp;  <td>A4</td>
    = ;    </tr>
    &n= bsp;   <tr>
     =      <td>B1</td>
 &nb= sp;        <td>B2</td>
          <t= d>B3</td>
      &nb= sp;   <td>B4</td>
   =      </tr>
   &nb= sp;  </tbody>
    </table>=
  </table-wrap>
\stopbuffer
<= /div>

\startxmlsetups xml:tabletestsetups
    \xmlsetsetup{#1}{*}{-}
  &= nbsp; % tables
    \xmlsetsetup{#1}{table-w= rap|table}{xml:*}
    \xmlsetsetup{#1}{thea= d|tbody|tr|th|td}{xml:table:*}
    \xmlsets= etup{#1}{colgroup|col}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:tabletestsetups}
\startxmlsetups xml:table-wrap
  &nb= sp; \startplacetable
      &= nbsp; % \contextversion \par
     = ;   \xmlflush{#1}
    \stopplacet= able
\stopxmlsetups

\startxml= setups xml:table
    \bTABLE
=         \xmlflush{#1}
&= nbsp;   \eTABLE
\stopxmlsetups
\startxmlsetups xml:colgroup
   = ; \xmlflush{#1}
\stopxmlsetups

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

\startxmlsetups xml:table:thead
   = \bTABLEhead
        \x= mlflush{#1}
    \eTABLEhead
\= stopxmlsetups

\startxmlsetups xml:table:tr<= br>
    \bTR
   &n= bsp;    \xmlflush{#1}
    \e= TR
\stopxmlsetups

\startxmlse= tups xml:table:th
    \bTH
&n= bsp;       \xmlflush{#1}
&nb= sp;   \eTH
\stopxmlsetups

\startxmlsetups xml:table:tbody
    = \bTABLEbody
        \xm= lflush{#1}
    \eTABLEbody
\s= topxmlsetups

\startxmlsetups xml:table:td
    \bTC
   &nb= sp;    \xmlflush{#1}
    \eT= C
\stopxmlsetups

\xmlprocessb= uffer{main}{table}{}
~~~~~~~~~~~~

All the best,
Ben

Ben Moon
ben@themoons.uk

--626503fa1b074fba98c8eb39ad1dee4a-- --===============1857779378812428868== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============1857779378812428868==--