From: Keith McKay <mckaymeister@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: First example in xml-mkiv.pdf
Date: Tue, 5 Jun 2018 21:03:51 +0100 [thread overview]
Message-ID: <5d6fddf2-c1d7-5560-7c1a-a7691143a672@gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1976 bytes --]
Dear List,
In my continuing effort to improve my ConTeXt skills I thought I would
have a look at XML and ConTeXt. Note: I have no XML skills but, "in for
a penny, in for a pound", as they say over here. I started by looking at
the very first example on page 5 of "Dealing with XML in ConTeXt mkiv"
and straight away hit a problem. There is a typo in the first line of
the XML file which I corrected:
<?xml version='1.0' standalone='yes?>
should be
<?xml version="1.0" standalone="yes"?>
However when I ran the file using the tex file it only produced a 3 page
pdf with a contents page and 2 title pages and no other text.
Here is the XML file which is the similar to the one on page 5 but with
two sections rather than one:
<?xml version="1.0" standalone="yes"?>
<document>
<section>
<title>Some title</title>
<content>
<p>a paragraph of text</p>
<p>another paragraph of text</p>
</content>
</section>
<section>
<title>Another title</title>
<content>
<p>a paragraph of text</p>
<p>another paragraph of text</p>
</content>
</section>
</document>
The TeX file is cut and pasted from pages 5 and 6 of xml-mkiv.pdf:
\startxmlsetups xml:demo:base
\xmlsetsetup{#1}{document|section|p|itemize|item}{xml:demo:*}
\stopxmlsetups
\xmlregisterdocumentsetup{demo}{xml:demo:base}
\startxmlsetups xml:demo:document
\starttitle[title={Contents}]
\placelist[chapter]
\stoptitle
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:demo:section
\startchapter[title=\xmlfirst{#1}{/title}]
\xmlfirst{#1}{/content}
\stopchapter
\stopxmlsetups
\startxmlsetups xml:demo:p
\xmlflush{#1}\endgraf
\stopxmlsetups
\xmlprocessfile{demo}{demo.xml}{}
This seemed such a simple example and I'm a bit perplexed as to why it
did not work. Can somebody explain why no paragraphs are showing up? I'm
using:
ConTeXt ver: 2018.04.04 00:51 MKIV beta fmt: 2018.6.2 int: english/english
LuaTeX, Version 1.07.0 (TeX Live 2018)
Thanks and Best Wishes
Keith McKay
[-- Attachment #1.2: Type: text/html, Size: 8388 bytes --]
[-- Attachment #2: Type: text/plain, Size: 492 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
next reply other threads:[~2018-06-05 20:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-05 20:03 Keith McKay [this message]
2018-06-06 13:32 ` Hans Hagen
2018-06-06 13:38 ` Keith McKay
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=5d6fddf2-c1d7-5560-7c1a-a7691143a672@gmail.com \
--to=mckaymeister@gmail.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).