ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Denis Maier <denis.maier.lists@mailbox.org>
To: ntg-context@ntg.nl
Subject: Best way to store text for later use
Date: Fri, 18 Sep 2020 15:36:11 +0200	[thread overview]
Message-ID: <c7f14648-f2a2-46a4-1b0a-4f5ae48e7379@mailbox.org> (raw)
In-Reply-To: <6660b3e6-42d5-a829-8a1d-3d8411719d7e@mailbox.org>

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
___________________________________________________________________________________

       reply	other threads:[~2020-09-18 13:36 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 [this message]
2020-09-18 16:18   ` Hans van der Meer
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=c7f14648-f2a2-46a4-1b0a-4f5ae48e7379@mailbox.org \
    --to=denis.maier.lists@mailbox.org \
    --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).