From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/90704 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: problem with interaction and TOC Date: Sun, 22 Mar 2015 12:46:35 +0100 Message-ID: References: <550DE783.6000502@gmx.es> <550DFE5C.2030003@wxs.nl> <550E9F1B.2010202@gmx.es> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) Content-Type: multipart/mixed; boundary="===============0225527431==" X-Trace: ger.gmane.org 1427024856 25323 80.91.229.3 (22 Mar 2015 11:47:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Mar 2015 11:47:36 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Mar 22 12:47:22 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YZeLf-0006xQ-KU for gctc-ntg-context-518@m.gmane.org; Sun, 22 Mar 2015 12:47:19 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D1DA510432 for ; Sun, 22 Mar 2015 12:47:18 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id kp3bQ5hAl7l0 for ; Sun, 22 Mar 2015 12:47:17 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id BE1921022E for ; Sun, 22 Mar 2015 12:46:50 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 93B70101F9 for ; Sun, 22 Mar 2015 12:46:46 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6YzM0dFdvvcr for ; Sun, 22 Mar 2015 12:46:45 +0100 (CET) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 7DD7E101E8 for ; Sun, 22 Mar 2015 12:46:40 +0100 (CET) Original-Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id t2MBkdpp009276 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sun, 22 Mar 2015 12:46:39 +0100 Original-Received: by wibg7 with SMTP id g7so18520245wib.1 for ; Sun, 22 Mar 2015 04:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=XgLU1Jgmp348NhWd3COYYcQajeSrA9S03GoAILrw7AQ=; b=JdYiabmoMnnst2aKmW0tryINPogemV1+olx2DeRTw9IjPhtoFCYGq311FmiDJkDQi9 wqXIYvvPH5AeY0FZQfudg/1EvnObmTcW2Y9f7wccsHAwT2P5w3w5+5XSHLUBd2iohnKM +rV0Vj/KEi6i00ujLLpSM1Rj8EViaDR8ursFdsfo5LG2HQHCx20200E3/X/JlXqfDgoy a0xprSYa/dYs7NvqNFdA4cgQGLTh7SpX78/I9fbdTBBMliQFtOtaWi85cD/NkOBLaw/u RpS+xknt+EUm13BtxJwjDr0n6OUqnI3jYYoP56ukEQHvqE2SlJqZ2MHDj6LVpJB0t+Pq ox6w== X-Received: by 10.180.76.230 with SMTP id n6mr10970241wiw.15.1427024798903; Sun, 22 Mar 2015 04:46:38 -0700 (PDT) Original-Received: from keima.localdomain (x2f2c11c.dyn.telefonica.de. [2.242.193.28]) by mx.google.com with ESMTPSA id hl8sm14530705wjb.38.2015.03.22.04.46.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 22 Mar 2015 04:46:38 -0700 (PDT) In-Reply-To: <550E9F1B.2010202@gmx.es> X-Mailer: Apple Mail (2.2070.6) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c05::22e; country=IE; latitude=53.3478; longitude=-6.2597; http://maps.google.com/maps?q=53.3478,-6.2597&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0RO6zKDG4 - cda8f567a254 - 20150322 (trained as not-spam) Received-SPF: pass (filter1-til.mf.surf.net: domain of schuster.wolfgang@gmail.com designates 2a00:1450:400c:c05::22e as permitted sender) receiver=filter1-til.mf.surf.net; client-ip=2a00:1450:400c:c05::22e; envelope-from=; helo=mail-wi0-x22e.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) 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:90704 Archived-At: --===============0225527431== Content-Type: multipart/alternative; boundary="Apple-Mail=_3BCB2658-8C2B-40FC-9289-5A4A985C6D96" --Apple-Mail=_3BCB2658-8C2B-40FC-9289-5A4A985C6D96 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Am 22.03.2015 um 11:53 schrieb Pablo Rodriguez : >=20 > On 03/22/2015 12:27 AM, Hans Hagen wrote: >> On 3/21/2015 10:49 PM, Pablo Rodriguez wrote: >>> Dear list, >>>=20 >>> I have the following sample: >>>=20 >>> \setupinteraction[state=3Dstart] >>> \starttext >>> \placelist[chapter] >>> %~ \uppercasestring{context}\to\ascii >>> %~ \chapter{\getvalue{\ascii}} >>> \chapter{ConTeXt} >>> \stoptext >>>=20 >>> ConTeXt complains about an error in the first line. >>>=20 >>> What am I doing wrong? (Sorry, but I wanted to test the commented = lines, >>> but I don=E2=80=99t know why the simplified example doesn=E2=80=99t = work.) >>=20 >> \uppercasestring{context}\to\ascii >> \chapter{\meaning\ascii} % \getvalue{\ascii}} >> \chapter{\WORD{ConTeXt}} >>=20 >> so, \ascii is made undefined at some time >=20 > Many thanks for your reply, Hans. >=20 > I=E2=80=99m afraid that my ignorance prevents me for understanding = your reply. >=20 > What I was trying to solve was this: >=20 > \startbuffer[demo] > >

ConTeXt

> ConTeXt > TeX > LaTeX >
> \stopbuffer You=E2=80=99re mixing tags, each ends with . > \setupinteraction[state=3Dstart] >=20 > \startxmlsetups xml:initialize > \xmlsetsetup{#1}{h1|span}{xml:*} > \xmlsetsetup{#1}{span[@label]}{xml:logo} > \xmlsetsetup{#1}{span[@label=3D'context']}{xml:context} > \stopxmlsetups >=20 > \xmlregistersetup{xml:initialize} >=20 > \startxmlsetups xml:h1 > \placecontent[criterium=3Dall] > \chapter{\xmlflush{#1}} > \stopxmlsetups >=20 > \startxmlsetups xml:logo > \uppercasestring\xmlatt{#1}{label}\xmlatt{#1}{name}\to\ascii > \ifx\ascii\empty\else\getvalue{\ascii}\fi > \stopxmlsetups >=20 > \startxmlsetups xml:context > \ConTeXt > \stopxmlsetups >=20 > \starttext > \xmlprocessbuffer{main}{demo}{} > \stoptext >=20 > xml:logo doesn=E2=80=99t work when it has to be parsed in a heading. >=20 > Is there a fix for xml:logo or is xml:context the proper fix? You need a expandable version for your logo tags. \startxmlsetups xml:logo \getvalue{\utfupper{\xmlatt{#1}{label}}} \stopxmlsetups You can also modify this and provide a text which appears when you try = to show a logo which isn=E2=80=99t defined. \startxmlsetups xml:logo \executeifdefined{\utfupper{\xmlatt{#1}{label}}}{{\tttf ???}} \stopxmlsetups Wolfgang= --Apple-Mail=_3BCB2658-8C2B-40FC-9289-5A4A985C6D96 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Am 22.03.2015 um 11:53 schrieb Pablo Rodriguez <oinos@gmx.es>:

On 03/22/2015 12:27 AM, Hans Hagen = wrote:
On 3/21/2015 10:49 PM, Pablo Rodriguez wrote:
Dear list,

I have the following sample:

    \setupinteraction[state=3Dstart]
    \starttext
    \placelist[chapter]
    %~ = \uppercasestring{context}\to\ascii
    %~ \chapter{\getvalue{\ascii}}
    \chapter{ConTeXt}
    \stoptext

ConTeXt complains about an error in the first line.

What am I doing wrong? (Sorry, but I wanted to = test the commented lines,
but I don=E2=80=99t know why the = simplified example doesn=E2=80=99t work.)

\uppercasestring{context}\to\ascii
\chapter{\meaning\ascii}  % \getvalue{\ascii}}
\chapter{\WORD{ConTeXt}}

so, = \ascii is made undefined at some time

Many thanks for your reply, Hans.

I=E2=80=99m afraid that my ignorance prevents me = for understanding your reply.

What I was trying to solve = was this:

   \startbuffer[demo]
   <doc>
       <h1><span = label=3D"context">ConTeXt</a></h1>
       <span= label=3D"context">ConTeXt</a>
       <span= label=3D"tex">TeX</a>
       <span= label=3D"latex">LaTeX</a>
   </doc>
   \stopbuffer

You=E2=80=99r= e mixing tags, each <span> ends with </a>.

   \setupinteraction[state=3Dstart]

   \startxmlsetups = xml:initialize
       \xmlsetsetup{#1}{h1|s= pan}{xml:*}
       \xmlsetsetup{#1}{span= [@label]}{xml:logo}
       \xmlsetsetup{#1}{span= [@label=3D'context']}{xml:context}
   \stopxmlsetups

   \xmlregistersetup{xml:initialize}

   \startxmlsetups = xml:h1
       \placecontent[criteri= um=3Dall]
       \chapter{\xmlflush{#1= }}
   \stopxmlsetups

   \startxmlsetups = xml:logo
       \uppercasestring\xmla= tt{#1}{label}\xmlatt{#1}{name}\to\ascii
       \ifx\ascii\empty\else= \getvalue{\ascii}\fi
   \stopxmlsetups

   \startxmlsetups = xml:context
       \ConTeXt
   \stopxmlsetups

   \starttext
        \xmlprocessbuff= er{main}{demo}{}
   \stoptext

xml:logo doesn=E2=80=99t work when it has to be = parsed in a heading.

Is there a fix for = xml:logo or is xml:context the proper fix?

You need a expandable version for your logo = tags.

   \startxmlsetups xml:logo
      =  \getvalue{\utfupper{\xmlatt{#1}{label}}}
 =  \stopxmlsetups

You can also modify this and provide a text which appears = when you try to show a logo which isn=E2=80=99t defined.

  =  \startxmlsetups xml:logo
      =  \executeifdefined{\utfupper{\xmlatt{#1}{label}}}{{\tttf = ???}}
   \stopxmlsetups

Wolfgang
= --Apple-Mail=_3BCB2658-8C2B-40FC-9289-5A4A985C6D96-- --===============0225527431== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============0225527431==--