ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans van der Meer <havdmeer@ziggo.nl>
To: NTG ConTeXt <ntg-context@ntg.nl>
Subject: Re: Best way to store text for later use
Date: Fri, 18 Sep 2020 18:18:13 +0200	[thread overview]
Message-ID: <165ADFB1-3350-475C-ABB3-4B716A5B7E5D@ziggo.nl> (raw)
In-Reply-To: <c7f14648-f2a2-46a4-1b0a-4f5ae48e7379@mailbox.org>


[-- Attachment #1.1: Type: text/plain, Size: 2698 bytes --]

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:
> 
> ==================
> \startxmlsetups xml:article-meta
>     \setupdocument [
> pub-year=\xmlfilter{#1}{/pub-date/year/command(xml:article-meta:pubdate:year)},
> volume=\xmlfilter{#1}{/volume/command(xml:article-meta:volume)},
> doi=\xmlfilter{#1}{/article-id[@pub-id-type='doi']/command(xml:article-meta:doi)},
> elocation-id=\xmlfilter{#1}{/elocation-id/command(xml:article-meta:elocation-id)},
> title=\xmlfilter{#1}{/title-group/article-title/command(xml:article-meta:title-group:article-title)},
>         author={\AuthorList},
>     ]
>   \startbuffer[abstract]
>       \xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)}
>   \stopbuffer
>    \xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:article-meta:abstract
>     \xmlflush{#1}
> \stopxmlsetups
> ===================
> 
> This here works:
> 
> ==================
> \startxmlsetups xml:article-meta
>     \setupdocument [
> pub-year=\xmlfilter{#1}{/pub-date/year/command(xml:article-meta:pubdate:year)},
> volume=\xmlfilter{#1}{/volume/command(xml:article-meta:volume)},
> doi=\xmlfilter{#1}{/article-id[@pub-id-type='doi']/command(xml:article-meta:doi)},
> elocation-id=\xmlfilter{#1}{/elocation-id/command(xml:article-meta:elocation-id)},
> title=\xmlfilter{#1}{/title-group/article-title/command(xml:article-meta:title-group:article-title)},
>         author={\AuthorList},
> abstract=\xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)},
>     ]
>    \xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:article-meta:abstract
>     \xmlflush{#1}
> \stopxmlsetups
> ===================
> 
> 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
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 5151 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

  reply	other threads:[~2020-09-18 16:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6660b3e6-42d5-a829-8a1d-3d8411719d7e@mailbox.org>
2020-09-18 13:36 ` Denis Maier
2020-09-18 16:18   ` Hans van der Meer [this message]
2020-10-02 10:57     ` Denis Maier
2020-09-18 17:02   ` Hans Hagen
2020-09-18 18:59     ` Denis Maier
2020-09-19  9:59       ` Hans Hagen
2020-09-19 14:31         ` Denis Maier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=165ADFB1-3350-475C-ABB3-4B716A5B7E5D@ziggo.nl \
    --to=havdmeer@ziggo.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).