From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/108751 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hans van der Meer Newsgroups: gmane.comp.tex.context Subject: Re: Best way to store text for later use Date: Fri, 18 Sep 2020 18:18:13 +0200 Message-ID: <165ADFB1-3350-475C-ABB3-4B716A5B7E5D@ziggo.nl> References: <6660b3e6-42d5-a829-8a1d-3d8411719d7e@mailbox.org> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Content-Type: multipart/mixed; boundary="===============9183384435690024442==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39380"; mail-complaints-to="usenet@ciao.gmane.io" To: NTG ConTeXt Original-X-From: ntg-context-bounces@ntg.nl Fri Sep 18 18:19:04 2020 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 1kJJ6G-000A8h-OK for gctc-ntg-context-518@m.gmane-mx.org; Fri, 18 Sep 2020 18:19:04 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 73FE61A8F78; Fri, 18 Sep 2020 18:18:18 +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 Opy3vSaFjD4U; Fri, 18 Sep 2020 18:18:16 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C9CDB1A8FB9; Fri, 18 Sep 2020 18:18:16 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id D7D3B1A8FB6 for ; Fri, 18 Sep 2020 18:18:15 +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 oOPVYFQqZ7zX for ; Fri, 18 Sep 2020 18:18:14 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=212.54.42.167; helo=smtpq4.tb.mail.iss.as9143.net; envelope-from=havdmeer@ziggo.nl; receiver= Original-Received: from smtpq4.tb.mail.iss.as9143.net (smtpq4.tb.mail.iss.as9143.net [212.54.42.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id DE86F1A8F78 for ; Fri, 18 Sep 2020 18:18:14 +0200 (CEST) Original-Received: from [212.54.42.110] (helo=smtp7.tb.mail.iss.as9143.net) by smtpq4.tb.mail.iss.as9143.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJJ5S-0008BP-D9 for ntg-context@ntg.nl; Fri, 18 Sep 2020 18:18:14 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ziggo.nl; s=202002corplgsmtpnl; h=To:Date:Subject:From; bh=K7KUuSPhREygavohLqhCeEuaLCqVaknqlRmr80gLq98=; b=KcjfxMTAWe/X3daqyyJ57QYD6Z Q+3vTeyd2aLDlKZV4M/QNZKGE91NbHKPhhPVUA3jJzsW2jgBFNs5n2Y3vMlgKmkDAgVg3L4xWWB5A ASVyGwdqucV5VOCXUsxDSq+h4qWTQXf/8Bo52tjAcSgd0xF1/owxiF8N3iUhqceKjNiPRJBoOAhKk Ca66cUtge1duXtg10P3KK0cG2lcBsg2lzF1J93otEMJmhjxfsUPkVzblmwgUFN9celhdGczXwBOpG E1epPxLzEDgdmwUv4VCez+PQQhD5SpYZxx4oMn9dhQBJx80MKa9c5vVDjS6PJxJ0lu/WL9VL8oKbL SzXIvvgQ==; Original-Received: from 84-106-134-200.cable.dynamic.v4.ziggo.nl ([84.106.134.200] helo=[192.168.178.11]) by smtp7.tb.mail.iss.as9143.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kJJ5S-0003mk-8q for ntg-context@ntg.nl; Fri, 18 Sep 2020 18:18:14 +0200 In-Reply-To: X-Mailer: Apple Mail (2.3608.120.23.2.1) X-SourceIP: 84.106.134.200 X-Authenticated-Sender: havdmeer@ziggo.nl (via SMTP) X-Ziggo-spambar: / X-Ziggo-spamscore: 0.0 X-Ziggo-spamreport: CMAE Analysis: v=2.4 cv=EM64b3VC c=1 sm=1 tr=0 ts=5f64ddc6 a=wCstmS+ZHA3zSJXjQC+ubA==:17 a=9+rZDBEiDlHhcck0kWbJtElFXBc=:19 a=reM5J-MqmosA:10 a=b3CbU_ItAAAA:8 a=MiNTnEJAAAAA:8 a=YEMqx4UAAAAA:8 a=ACQCx6kCAAAA:8 a=xtERp6CFAAAA:8 a=a3nu-2BBAAAA:8 a=NJHqKQoD1Wrm5afv9csA:9 a=CjuIK1q_8ugA:10 a=ZcMHSawxTBqVGj3BrSYA:9 a=03wSFrQCRGsv4sYN:21 a=_W_S_7VecoQA:10 a=Rv2g8BkzVjQTVhhssdqe:22 a=LmrbSfiT3hecnSZifb5M:22 a=V0662LiR8DSfwiDagK97:22 a=Sab0UneHBzlWrQDlOuxD:22 a=ekCXXmE-vB8RPiJ3MEZb:22 X-Ziggo-Spam-Status: No 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:108751 Archived-At: --===============9183384435690024442== Content-Type: multipart/alternative; boundary="Apple-Mail=_B4BC83BC-5F8E-427D-BA8D-97C74F2E508B" --Apple-Mail=_B4BC83BC-5F8E-427D-BA8D-97C74F2E508B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii A possibility is saving the data as text in a Lua-table. If you are not = afraid to use some Lua, I can send my code for saving files and data for = repeated use. dr. Hans van der Meer > On 18 Sep 2020, at 15:36, Denis Maier = wrote: >=20 > Hi, >=20 > For typesetting XML I'm wondering how to best store text for later = use: >=20 > I've tried using buffers, but this here doesn't work: >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > \startxmlsetups xml:article-meta > \setupdocument [ > = pub-year=3D\xmlfilter{#1}{/pub-date/year/command(xml:article-meta:pubdate:= year)}, > volume=3D\xmlfilter{#1}{/volume/command(xml:article-meta:volume)}, > = doi=3D\xmlfilter{#1}{/article-id[@pub-id-type=3D'doi']/command(xml:article= -meta:doi)}, > = elocation-id=3D\xmlfilter{#1}{/elocation-id/command(xml:article-meta:eloca= tion-id)}, > = title=3D\xmlfilter{#1}{/title-group/article-title/command(xml:article-meta= :title-group:article-title)}, > author=3D{\AuthorList}, > ] > \startbuffer[abstract] > \xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)} > \stopbuffer > \xmlflush{#1} > \stopxmlsetups >=20 > \startxmlsetups xml:article-meta:abstract > \xmlflush{#1} > \stopxmlsetups > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > This here works: >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > \startxmlsetups xml:article-meta > \setupdocument [ > = pub-year=3D\xmlfilter{#1}{/pub-date/year/command(xml:article-meta:pubdate:= year)}, > volume=3D\xmlfilter{#1}{/volume/command(xml:article-meta:volume)}, > = doi=3D\xmlfilter{#1}{/article-id[@pub-id-type=3D'doi']/command(xml:article= -meta:doi)}, > = elocation-id=3D\xmlfilter{#1}{/elocation-id/command(xml:article-meta:eloca= tion-id)}, > = title=3D\xmlfilter{#1}{/title-group/article-title/command(xml:article-meta= :title-group:article-title)}, > author=3D{\AuthorList}, > abstract=3D\xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)},= > ] > \xmlflush{#1} > \stopxmlsetups >=20 > \startxmlsetups xml:article-meta:abstract > \xmlflush{#1} > \stopxmlsetups > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > But has using a variable for the abstract any drawbacks? (The abstract = might contain multiple paragraphs.) >=20 > Best, > Denis > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > 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 > = __________________________________________________________________________= _________ --Apple-Mail=_B4BC83BC-5F8E-427D-BA8D-97C74F2E508B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii A = possibility is saving the data as text in a Lua-table. If you are not = afraid to use some Lua, I can send my code for saving files and data for = repeated use.

dr. Hans van der Meer


On 18 Sep 2020, at 15:36, Denis Maier <denis.maier.lists@mailbox.org> wrote:

Hi,
For typesetting XML I'm wondering how to best = store text for later use:

I've tried using = buffers, but this here doesn't work:

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
\startxmlsetups xml:article-meta
    \setupdocument [
pub-year=3D\xmlfilter{#1}{/pub-date/year/command(xml:article-me= ta:pubdate:year)},
volume=3D\xmlfilter{#1}{/volume/command(xml:article-meta:volume= )},
doi=3D\xmlfilter{#1}{/article-id[@pub-id-type=3D'doi']/command(= xml:article-meta:doi)},
elocation-id=3D\xmlfilter{#1}{/elocation-id/command(xml:article= -meta:elocation-id)},
title=3D\xmlfilter{#1}{/title-group/article-title/command(xml:a= rticle-meta:title-group:article-title)},
    =     author=3D{\AuthorList},
    ]
  = \startbuffer[abstract]
      = \xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)}
  \stopbuffer
   = \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:article-meta:abstract
    \xmlflush{#1}
\stopxmlsetups
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D

This here works:

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
\startxmlsetups xml:article-meta
    \setupdocument [
pub-year=3D\xmlfilter{#1}{/pub-date/year/command(xml:article-me= ta:pubdate:year)},
volume=3D\xmlfilter{#1}{/volume/command(xml:article-meta:volume= )},
doi=3D\xmlfilter{#1}{/article-id[@pub-id-type=3D'doi']/command(= xml:article-meta:doi)},
elocation-id=3D\xmlfilter{#1}{/elocation-id/command(xml:article= -meta:elocation-id)},
title=3D\xmlfilter{#1}{/title-group/article-title/command(xml:a= rticle-meta:title-group:article-title)},
    =     author=3D{\AuthorList},
abstract=3D\xmlfilter{#1}{/abstract/command(xml:article-meta:ab= stract)},
    ]
   = \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:article-meta:abstract
    \xmlflush{#1}
\stopxmlsetups
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D

But has using a = variable for the abstract any drawbacks? (The abstract might contain = multiple paragraphs.)

Best,
Denis
_______________________________________________________________= ____________________
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
_______________________________________________________________= ____________________

= --Apple-Mail=_B4BC83BC-5F8E-427D-BA8D-97C74F2E508B-- --===============9183384435690024442== 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== --===============9183384435690024442==--