[NTG-context] Best way to store text for later use
Hans van der Meer
havdmeer at ziggo.nl
Fri Sep 18 18:18:13 CEST 2020
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 at 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 at 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
> ___________________________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20200918/c033afb2/attachment-0001.htm>
More information about the ntg-context
mailing list