From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/114747 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ben Moon via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: xmlpos values doubled Date: Wed, 20 Apr 2022 10:51:53 +0100 Message-ID: <33882cbd-d469-4c41-ae07-2d0368758316@www.fastmail.com> References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1679216330804807596==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15732"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.7.0-alpha0-568-g521196dd5d-fm-20220414.001-g521196dd Cc: Ben Moon To: "Context Mailing List" Original-X-From: ntg-context-bounces@ntg.nl Wed Apr 20 12:01:43 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 1nh79b-0003se-7W for gctc-ntg-context-518@m.gmane-mx.org; Wed, 20 Apr 2022 12:01:43 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4DCFA289D6E; Wed, 20 Apr 2022 12:00:53 +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 IQEdxORBTe_N; Wed, 20 Apr 2022 12:00:50 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id D4699289D65; Wed, 20 Apr 2022 12:00:50 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id F3468289D6C for ; Wed, 20 Apr 2022 12:00:49 +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 FxFdwM7CdY4F for ; Wed, 20 Apr 2022 12:00:48 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=66.111.4.27; helo=out3-smtp.messagingengine.com; envelope-from=ben@themoons.uk; receiver= X-Greylist: delayed 488 seconds by postgrey-1.36 at zapf.ntg.nl; Wed, 20 Apr 2022 12:00:47 CEST Original-Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (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 E0749289D44 for ; Wed, 20 Apr 2022 12:00:47 +0200 (CEST) Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id DD9905C009C for ; Wed, 20 Apr 2022 05:52:37 -0400 (EDT) Original-Received: from imap46 ([10.202.2.96]) by compute5.internal (MEProxy); Wed, 20 Apr 2022 05:52:37 -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:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1650448357; x=1650534757; bh=9p1ZHjIJ7m Gib6YKx9xjBH/yEt309a5PDli1Cal29CY=; b=sNKG/rK1HX8A8oF/z1zMEFafdL 4Jdt8ICXS3hwh8yey9aM03ojiTxWpllKINu0jEuKYEYBTjJS7PliNIro8PlqilXf kiVEEUqqC8mC1OXZahJ8DuXjLi4xY+A/maNeqEOZj3hA/I58FAj6SAugefjzuUqR JRCCwzf724px/wQBlmlj8kzs2Kq3S/K/+pvAdJvW9E5PRrM0u+DyP2YKROLLoN2T 4AkivWizpa4V2GnJlye3zZsqiWMQpmqUZU/HPRiF+VzRTXA2sD9E/6S8x0L75cDO CpZl5wSGBSRU2rGA0DLoJ9SZKzUA1zS1uaTcDZmHR3auYjfCSUjWpvX8h2Fw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1650448357; x= 1650534757; bh=9p1ZHjIJ7mGib6YKx9xjBH/yEt309a5PDli1Cal29CY=; b=d 6ruC0B6vz9z/ROq1rj6eYYC/812RpHCHXVXov5knaBLPwx7RB3tNVaTTSkyONtDp fYHaTdlCZW692qA23TIgT/WUcD7JotT9hy/2grfvMVPIvKfGiE9qmoA8Uni8g2F8 gVgnO3uRH/x8wl2X5pgV1Xl/X9vXcqK5ibScokEPJ+A/QkPoQkwapZMPORBn/7gY /O0B+qkFylU3yfqCQyvamd/Tm2+VRyrYKEO0WhngWdzpyriLo2AYhFojxUmKhrQ5 R4OQqXFvf/ipLCDJa8MROmhxax+p5wsXCq53o8tEALubzmy6HpFMl46eR6ReyNww zl/ipOhLfmohI0Ebg5F0g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvddthedgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdlqdefmdenucfjughrpefofg ggkfgjfhffhffvufgtsegrtderreerredtnecuhfhrohhmpedfuegvnhcuofhoohhnfdcu oegsvghnsehthhgvmhhoohhnshdruhhkqeenucggtffrrghtthgvrhhnpeefieegvdeutd fhtdeiheeulefggfelvdevgfeuieeuledvffeluefhkeffudeiveenucffohhmrghinhep nhhihhdrghhovhdpnhhtghdrnhhlpdhprhgrghhmrgdqrgguvgdrnhhlpdgrrghnhhgvth drnhgvthdpsghithgsuhgtkhgvthdrohhrghdptghonhhtvgigthhgrghruggvnhdrnhgv thenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsvg hnsehthhgvmhhoohhnshdruhhk X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 9DDD31EE0083; Wed, 20 Apr 2022 05:52:37 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: 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:114747 Archived-At: --===============1679216330804807596== Content-Type: multipart/alternative; boundary=f761308f1f3742f08b81b4481a4b2d03 --f761308f1f3742f08b81b4481a4b2d03 Content-Type: text/plain Hello again, I wonder whether anyone has some thoughts to help with my problem? Either why \xmlpos gives double values or alternatives to arrange my table format? Best wishes, Ben On Mon, 28 Mar 2022, at 10:44, Ben Moon via ntg-context wrote: > 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)H3H4
A1A2A3A4
B1B2B3B4
>
> \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 > > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to the Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___________________________________________________________________________________ > --f761308f1f3742f08b81b4481a4b2d03 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
Hello agai= n,

I wonder whether anyone has some thought= s to help with my problem? Either why \xmlpos gives double values or alt= ernatives to arrange my table format?

Best = wishes,
Ben


On Mon= , 28 Mar 2022, at 10:44, Ben Moon via ntg-context wrote:
Hello All,
<= br>
I'm trying to render a table stored in XML JATS format (https://jats.nlm.nih.gov/a= rchiving/) and eventually want to use the <colgroup> tag to se= tup column aligning from the @align attribute, e.g.,

<= /div>
    \setupTABLE [column] [\xmlpos{#1}] [align=3D\xml= att{#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 <colgro= up>  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[t= able]
  <table-wrap>
  =   <table>
      <co= lgroup>
        <= 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>=
          &l= t;th>H3</th>
      =     <th>H4</th>
  &nb= sp;     </tr>
   =    </thead>
     = <tbody>
        = <tr>
        = ;  <td>A1</td>
    &n= bsp;     <td>A2</td>
 = ;         <td>A3</td>= ;
          &= lt;td>A4</td>
      = ;  </tr>
      &n= bsp; <tr>
       =    <td>B1</td>
   &nb= sp;      <td>B2</td>
=           <td>B3</= td>
        &nb= sp; <td>B4</td>
     =    </tr>
      &l= t;/tbody>
    </table>
  </table-wrap>
\stopbuffer
\startxmlsetups xml:tabletestsetups
 &nb= sp;  \xmlsetsetup{#1}{*}{-}
    % tabl= es
    \xmlsetsetup{#1}{table-wrap|table}{x= ml:*}
    \xmlsetsetup{#1}{thead|tbody|tr|t= h|td}{xml:table:*}
    \xmlsetsetup{#1}{col= group|col}{xml:*}
\stopxmlsetups

<= div>\xmlregistersetup{xml:tabletestsetups}

= \startxmlsetups xml:table-wrap
    \startpl= acetable
        % \con= textversion \par
       = ; \xmlflush{#1}
    \stopplacetable
\stopxmlsetups

\startxmlsetups xml:t= able
    \bTABLE
  =       \xmlflush{#1}
  &= nbsp; \eTABLE
\stopxmlsetups

= \startxmlsetups xml:colgroup
    \xmlflush{= #1}
\stopxmlsetups

\startxmls= etups xml:col
    \xmlpos{#1} \xmlatt{#1}{a= lign}\par
\stopxmlsetups

\sta= rtxmlsetups xml:table:thead
    \bTABLEhead=
        \xmlflush{#1}<= br>
    \eTABLEhead
\stopxmlsetup= s

\startxmlsetups xml:table:tr
    \bTR
     &n= bsp;  \xmlflush{#1}
    \eTR
=
\stopxmlsetups

\startxmlsetups xml:tab= le:th
    \bTH
  &n= bsp;     \xmlflush{#1}
  &nb= sp; \eTH
\stopxmlsetups

\star= txmlsetups xml:table:tbody
    \bTABLEbody<= br>
        \xmlflush{#1}
    \eTABLEbody
\stopxmlsetups=

\startxmlsetups xml:table:td
    \bTC
     &nb= sp;  \xmlflush{#1}
    \eTC
<= div>\stopxmlsetups

\xmlprocessbuffer{main}{= table}{}
~~~~~~~~~~~~

All the= best,
Ben


Ben Moon
ben@themoons.uk

_= ________________________________________________________________________= __________
If your question is of interest to others as we= ll, please add an entry to the Wiki!

wiki     : http://contextgarden.net
___= ________________________________________________________________________= ________


--f761308f1f3742f08b81b4481a4b2d03-- --===============1679216330804807596== 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== --===============1679216330804807596==--