From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/100945 Path: news.gmane.org!.POSTED!not-for-mail From: Keith McKay Newsgroups: gmane.comp.tex.context Subject: Re: First example in xml-mkiv.pdf Date: Wed, 6 Jun 2018 14:38:50 +0100 Organization: The PotHole Press Message-ID: References: <5d6fddf2-c1d7-5560-7c1a-a7691143a672@gmail.com> <58c51bf2-eab2-c1f9-972d-2de8871fb908@xs4all.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6761928219486269239==" X-Trace: blaine.gmane.org 1528292240 16112 195.159.176.226 (6 Jun 2018 13:37:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 6 Jun 2018 13:37:20 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Wed Jun 06 15:37:16 2018 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fQYcl-00045U-LK for gctc-ntg-context-518@m.gmane.org; Wed, 06 Jun 2018 15:37:15 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E062932A47; Wed, 6 Jun 2018 15:39:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gRBR7p9OUdnm; Wed, 6 Jun 2018 15:39:06 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 2094532AD3; Wed, 6 Jun 2018 15:39:06 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C3B0A32A21 for ; Wed, 6 Jun 2018 15:39:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u5GuID_2uAzQ for ; Wed, 6 Jun 2018 15:39:03 +0200 (CEST) Original-Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 6E06C3071D for ; Wed, 6 Jun 2018 15:38:53 +0200 (CEST) Original-Received: by mail-wm0-f47.google.com with SMTP id p11-v6so12044724wmc.4 for ; Wed, 06 Jun 2018 06:38:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:organization:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=eyUjqZN1t5+mF3R3vRKF6jn+1uWSLYXWw7sl0UcOC30=; b=Krir/q8wVmnGNw7QWMmKmWxaVcneeh/CQvUChhFkZoa7EhMzgSDERQe0abGrKmnAkv UHYwmdNXpOm22sdTyCo9Pi2MubvYh3skm7u4gUjSeHtfQ5tNhs2Q+etV1/M1britVBDl w3dS/0tl1ja7b/Xh0QZq3ImqYGqRs/6uLzJGeqRB9/OSeNCqIQbsgghDxUXqcb7AkN2I f8b8n0NdXcUg4T36w58Sknt7eee8LsFWWXeuBMA7enx/04bflu+OBf6S96ZNJfxNUPGI GIf7BXHDxwa3vj5LZxrU1D83kMgtyfRV7+RYc9z86KrRECA5VPNpEULcvJ0V1PB+8h8I i+mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language; bh=eyUjqZN1t5+mF3R3vRKF6jn+1uWSLYXWw7sl0UcOC30=; b=huwAdSmOSkJi6le/kmfK0P6fVH/2MSurZog9CmN0bkmiGd1SF/V8YzAzVHWbDVHEIi FfYTQVSBtUG6GrRENvLACYl8jzphK3RsphIjLmqMXl6cG6Y9MeaPpITKhML55QNFpC9o NVloxizIczjcKe/KcwApZn71kxRaYNlpNkZHBw0LgAf02G8TWhrZTbpmQ9BsPcgG0pVH 2pi0EZma4BNXvH6uTbx2A/gyrZLcHX8BWvWhqv+Dejj9efU28atdbBLPJfSFGgi/goBt dlpi++lFg3tZ8ep6hI1zS+1Gk+IH85jiUBZiZW/Fly4R7xkIek4U17qlBL9VMBl5mA1l C7Iw== X-Gm-Message-State: APt69E1rcLNhU03gAVEesib4fq3MqvzrdSjjmTecmCemNroJB4FB2Zr0 udAhjeqA1F1QhiRQxZiSSEGIKw== X-Google-Smtp-Source: ADUXVKIwUWRlwz8pvD6VS4Z0eH0qTFmnJ8+43TFA3mb27BJrSvpqD1+4JEenRFRoX+M/mqNCGub67g== X-Received: by 2002:a1c:64c5:: with SMTP id y188-v6mr1808151wmb.45.1528292332589; Wed, 06 Jun 2018 06:38:52 -0700 (PDT) Original-Received: from Keiths-Mac-mini.local (cpc1-uddi28-2-0-cust125.20-3.cable.virginm.net. [92.236.230.126]) by smtp.googlemail.com with ESMTPSA id e4-v6sm36148876wrq.4.2018.06.06.06.38.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jun 2018 06:38:51 -0700 (PDT) In-Reply-To: <58c51bf2-eab2-c1f9-972d-2de8871fb908@xs4all.nl> Content-Language: en-US X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:100945 Archived-At: This is a multi-part message in MIME format. --===============6761928219486269239== Content-Type: multipart/alternative; boundary="------------F968A2D75B13B4B69F908EBC" Content-Language: en-US This is a multi-part message in MIME format. --------------F968A2D75B13B4B69F908EBC Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Aah yes, how silly of me to forget to add \starttext... \stoptext! Thanks for your help. Best Wishes Keith On 06/06/2018 14:32, Hans Hagen wrote: > On 6/5/2018 10:03 PM, Keith McKay wrote: >> 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: >> >> >> >> should be >> >> >> >> 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: >> >> >> >> >> >>
>> >> Some title >> >> >> >>

a paragraph of text

>> >>

another paragraph of text

>> >>
>> >>
>> >>
>> >> Another title >> >> >> >>

a paragraph of text

>> >>

another paragraph of text

>> >>
>> >>
>> >>
>> >> 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 > you need to add \starttext ... \stoptext > > \startbuffer[demo] > > > >    
>         Some title >         >            

a paragraph of text

>            

another paragraph of text

>        
>    
>    
>         Another title >         >            

a paragraph of text

>            

another paragraph of text

>        
>    
>
> \stopbuffer > > \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 > > \starttext >     \xmlprocessbuffer{demo}{demo}{} > \stoptext > > > ----------------------------------------------------------------- >                                           Hans Hagen | PRAGMA ADE >               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands >        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > ----------------------------------------------------------------- > ___________________________________________________________________________________ > > 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 > ___________________________________________________________________________________ --------------F968A2D75B13B4B69F908EBC Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Aah yes, how silly of me to forget to add \starttext... \stoptext! Thanks for your help.

Best Wishes

Keith


On 06/06/2018 14:32, Hans Hagen wrote:
On 6/5/2018 10:03 PM, Keith McKay wrote:
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
you need to add \starttext ... \stoptext

\startbuffer[demo]
<?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>
\stopbuffer

\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

\starttext
    \xmlprocessbuffer{demo}{demo}{}
\stoptext


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


--------------F968A2D75B13B4B69F908EBC-- --===============6761928219486269239== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============6761928219486269239==--