From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: ConTeXt <ntg-context@ntg.nl>
Subject: Nested XML environments with MkIV
Date: Sat, 2 Feb 2008 19:42:14 +0100 [thread overview]
Message-ID: <20080202194214.0bb5f191.schuster.wolfgang@googlemail.com> (raw)
Hi,
I tried to get the following example with ConTeXt's old XML macros
in MkII with the new setup mechanism from MkIV.
\defineXMLenvironment [section] {Section:\par} {}
\defineXMLenvironment [p] \par \par
\startbuffer
<section>
<p>text text</p>
<section>
<p>text text</p>
</section>
<p>text text</p>
</section>
\stopbuffer
\starttext
\processXMLbuffer
\stoptext
My code for MkIV looks like:
\startxmlsetups xml:mysetups
\xmlsetsetup{\xmldocument}{section}{xml:section}
\xmlsetsetup{\xmldocument}{p}{xml:paragraph}
\stopxmlsetups
\xmlregistersetup{xml:mysetups}
\startxmlsetups xml:paragraph
\xmlflush{#1}\par
\stopxmlsetups
\startxmlsetups xml:section
Section:\par
\xmlflush{#1}
\stopxmlsetups
\startbuffer[section]
<section>
<p>text text</p>
<section>
<p>text text</p>
</section>
<p>text text</p>
</section>
\stopbuffer
\starttext
\xmlprocessbuffer{main}{section}{}
\stoptext
What I want is to insert or execute a macro at the begin of every new
section environment (I used the text "Section:") and this work fine
with XML definition but not with setups, only the first envionment is
executed and the rest is only read and flushed.
Wolfgang
___________________________________________________________________________________
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://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next reply other threads:[~2008-02-02 18:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-02 18:42 Wolfgang Schuster [this message]
2008-02-02 20:46 ` Hans Hagen
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=20080202194214.0bb5f191.schuster.wolfgang@googlemail.com \
--to=schuster.wolfgang@googlemail.com \
--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).