ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Denis Maier <denis.maier.lists@mailbox.org>
To: Hans Hagen <j.hagen@xs4all.nl>,
	mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Best way to store text for later use
Date: Sat, 19 Sep 2020 16:31:51 +0200	[thread overview]
Message-ID: <b6037c1a-9d3e-cab2-5bc1-fee316dfbbc9@mailbox.org> (raw)
In-Reply-To: <91fc7ae7-ad10-5f02-b7c3-69c81733a8d8@xs4all.nl>

Am 19.09.2020 um 11:59 schrieb Hans Hagen:
> On 9/18/2020 8:59 PM, Denis Maier wrote:
>>
>>
>> Am 18.09.2020 um 19:02 schrieb Hans Hagen:
>>> On 9/18/2020 3:36 PM, Denis Maier wrote:
>>>
>>>> I've tried using buffers, but this here doesn't work:
>>> Why not just fetch it when needed. There is no gain in storing it 
>>> and fetching from the xml tree is fast.
>>>
>> Most likely due to my limited understanding of how these things work. 
>> I thought storing the text and retrieving it later would be the 
>> easiest way to get rid of the constraints of linar processing of the 
>> XML file. The layout itself is determined by setups such as this one:
>
> there is no linear processing, you just start someplace and 
> recursively deal with the tree (which often looks like linear when you 
> start at the root but basically you can access everything everywhere)
>
>> \startsetups abstract
>>      \startabstract
>>          \documentvariable{abstract}
>>      \stopabstract
>> \stopsetups
>>
>> \setuphead [chapter][
>>      alternative=middle,
>>      page=yes,
>>      indentnext=no,
>>      style=\tfa\setupinterlinespace,
>>      after={\directsetup{placeauthors}\directsetup{abstract}},
>>      footer=chapterfooter,
>>      ]
>>
>> How could I fetch the xml node from here so I don't need a variable, 
>> buffer or the like?
> just pass the root element i.e. instead of #1 in
>
>  \xmlfilter{#1}{/abstract/command(xml:article-meta:abstract)}
>
> as #1 is just an abstraction for the current element; you pass the 
> name you used when loading the tree (often \xmldocument works too)
>

Thanks. That is very helpful. And indeed, that makes things much easier!

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-19 14:31 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
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 [this message]

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=b6037c1a-9d3e-cab2-5bc1-fee316dfbbc9@mailbox.org \
    --to=denis.maier.lists@mailbox.org \
    --cc=j.hagen@xs4all.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).