From: Hans Hagen <pragma@wxs.nl>
Cc: ntg-context <ntg-context@ntg.nl>
Subject: Re: XML processing
Date: Mon, 26 Aug 2002 16:40:26 +0200 [thread overview]
Message-ID: <5.1.0.14.1.20020826163848.021a7438@server-1> (raw)
In-Reply-To: <20020826123344.9BEC06%05570575@gmx.de>
At 12:33 PM 8/26/2002 +0100, Robbie Pickering wrote:
>OK, I'm stymied here.
>
>What i'm trying to do is typeset a dictionary entry from XML. It's
>relatively simple so far. But there are occasions when I'd like to have
>the same tags treated differently according to the context.
Maybe you can use:
\startXMLmapping [local]
\defineXMLenvironment [whatever] {[} {]}
\stopXMLmapping
\defineXMLenvironment [whatever] {(} {)}
\defineXMLenvironment [test]
{\startXMLmapping[local]}
{\stopXMLmapping}
\startbuffer
Let's see <whatever>how</whatever> a <test><whatever>how
some nested</whatever></test> text comes out.
\stopbuffer
\starttext \processXMLbuffer \stoptext
Alternaively you can use grouping and locally redefine elements.
>We have for example definitions DEFN which are sometimes followed by an
>example EGPH and sometimes not.
>
>...
><DNUM>3</DNUM>
><DEFN>a large body, esp. of a person</DEFN>
><EGPH>he eased his bulk out of the chair</EGPH>
><DNUM>4</DNUM>
><DEFN>unpackaged cargo or goods</DEFN>
>
>I have setup DEFN very simply
>
>\defineXMLenvironment [DEFN] {}{.}
>to add a full stop after the definition. It would be nice, though, to be
>able to automatically add a colon instead in those cases where the DEFN
>environment is immediately followed by a EGPH.
>
>is the XML parsing code robust enough that one could start messing
>around with counters, etc. in the arguments of a \defineXMLenvironment?
>Or is there a better way of going about this?
what kind of messing?
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | pragma@wxs.nl
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
information: http://www.pragma-ade.com/roadmap.pdf
documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------
next prev parent reply other threads:[~2002-08-26 14:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-26 11:33 Robbie Pickering
2002-08-26 14:40 ` Hans Hagen [this message]
2002-08-26 18:53 ` Simon Pepping
2002-08-26 19:25 ` Hans Hagen
2003-05-20 16:35 XML Processing Alexandre Enkerli
2003-05-21 8:11 ` Berend de Boer
2003-05-21 19:56 ` Simon Pepping
2003-05-21 20:12 ` Johannes Hüsing
2003-05-23 12:46 ` Hans Hagen
2011-12-31 20:55 xml processing Meer, H. van der
2012-01-01 12:14 ` 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=5.1.0.14.1.20020826163848.021a7438@server-1 \
--to=pragma@wxs.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).