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-contextwebpage :
http://www.pragma-ade.nl /
http://context.aanhet.netarchive :
https://bitbucket.org/phg/context-mirror/commits/wiki :
http://contextgarden.net___________________________________________________________________________________