ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Pablo Rodriguez <oinos@gmx.es>
To: ntg-context@ntg.nl
Subject: Re: Processing XML: Header and footer, data manipulation
Date: Mon, 22 Apr 2019 11:40:58 +0200	[thread overview]
Message-ID: <22cda6e1-216f-a2af-ed5c-90b8f2ebbbb6@gmx.es> (raw)
In-Reply-To: <82C3253A-0698-43FE-9FDC-0F08EDE8D5F7@axelkielhorn.de>

On 4/22/19 7:57 AM, Axel Kielhorn wrote:
> [...]
> Some questions remain:

Hi Axel,

I have some questions about your source file:

  \startxmlsetups xml:prozess
     \mainlanguage[de]

If this is hardcoded (I mean, you don’t read it from any XML code), I
would avoid setting the \mainlanguage here.

And you already set it in lines 82-83:

  \language[de]
  \mainlanguage[de]

BTW, is there any reason to set both \language and \mainlanguage?
(\mainlanguage should be enough.)

> I want to set page headers based on information I get from the XML:
>
> \startxmlsetups xml:prozess
>   \setupheadertexts[\bf\xmltext{#1}{/pnr} \xmltext{#1}{/pname}][\date]
>
> This works on the first page (when the document has more than one
> page) but headers and footers are empty on subsequent pages.
>
> Something (xmlflush?) overwrites my setup.
> Any idea how I can fix that?

I have a workaround for that:

  \title{\xmltext{#1}{/pnr} \xmltext{#1}{/pname}}

And in your preamble:

  \setupheadertexts[title][\date]
  \setuphead[title]
    [placehead=empty,
     before=,
     after=,
     page=,]

> I want to use xmlconcat here, since there may be more than one docan, but I only get the „, “
>
> \startxmlsetups xml:psoutdoc
> %    \inmargin{\xmltext{#1}{/docan} $\Leftarrow$}  {\bf \xmltext{#1}{/docnr}}\xmlflush{#1}
>     \inmargin{\xmlconcat{#1}{/docan}{, } $\Leftarrow$}  {\bf \xmltext{#1}{/docnr}}\xmlflush{#1}
>     \xmlsave{#1}{outfile.xml}
>     \blank
> \stopxmlsetups

I would avoid using:

  \startxmlsetups xml:docname
    \xmlflush{#1}
  \stopxmlsetups

instead of "\xmltext{#1}{/docname}" in the proper places.

You need to add to get proper content:

  \startxmlsetups xml:docan
    \xmlflush{#1}
  \stopxmlsetups

I would replace docname with docan in both places (xmlsetsetup and its
proper \starxmlsetups).

BTW, what should be child notes to #1? An special lpath or what?

Just in case it helps,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
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:[~2019-04-22  9:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-22  5:57 Axel Kielhorn
2019-04-22  9:40 ` Pablo Rodriguez [this message]
2019-04-22 15:50   ` Axel Kielhorn

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=22cda6e1-216f-a2af-ed5c-90b8f2ebbbb6@gmx.es \
    --to=oinos@gmx.es \
    --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).