ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Thomas A. Schmitz" <thomas.schmitz@uni-bonn.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Re: XML processing beginner's question
Date: Mon, 21 Aug 2023 18:19:37 +0200	[thread overview]
Message-ID: <2fc19213-4346-749b-e7dc-5c338b26f3a0@uni-bonn.de> (raw)
In-Reply-To: <GV2P251MB0993D46DC0612B2A6A4B820FDD1EA@GV2P251MB0993.EURP251.PROD.OUTLOOK.COM>

On 8/21/23 17:59, Michael Löscher wrote:
> Yes, I have done that. But I don't seem to have the basic context of how 
> the processing works in order. All I have so far is this as a starting 
> point:
> 
Really? I told you about the various commands \xmldoif, but there's 
nothing in your starting point. I don't want to provide anybody homework 
solutions, so just to give you an idea to get you started:

\startxmlsetups xml:mysetup
\xmlsetsetup{main}{document|element|mdata|tdata|name|date|num|content|shortdescription|p}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:mysetup}

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

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

\startxmlsetups xml:mdata
	\xmldoifelsetext {#1} {/date}
		{{\bf \xmltext {#1} {name}}\par
		{\it \xmltext {#1} {date}}\par}
		{\xmltext {#1} {content}\par}
\stopxmlsetups

This will process the name in bold and the date in italic. But I'm sure 
you can do better after reading and digesting the chapter I referred to.

Thomas

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2023-08-21 16:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-21 15:29 [NTG-context] " Michael Löscher
2023-08-21 15:45 ` [NTG-context] " Thomas A. Schmitz
2023-08-21 15:59   ` Michael Löscher
2023-08-21 16:19     ` Thomas A. Schmitz [this message]
     [not found]       ` <GV2P251MB09935835934E71D701185407DD1EA@GV2P251MB0993.EURP251.PROD.OUTLOOK.COM>
2023-08-21 16:56         ` Thomas A. Schmitz
2023-08-21 17:08           ` Hans Hagen via ntg-context
2023-08-22  6:53             ` denis.maier
2023-08-22  7:43               ` Hans Hagen via ntg-context
2023-08-22  7:06       ` denis.maier
2023-08-22  7:46         ` Hans Hagen via ntg-context
2023-08-21 19:21     ` 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=2fc19213-4346-749b-e7dc-5c338b26f3a0@uni-bonn.de \
    --to=thomas.schmitz@uni-bonn.de \
    --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).