From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/23918 Path: news.gmane.org!not-for-mail From: Richard Gabriel Newsgroups: gmane.comp.tex.context Subject: Re: ConTeXt, XML, multiple attributes evaluation Date: Tue, 29 Nov 2005 12:02:19 +0100 Message-ID: <20051129110219.c48dfb56@mx1.kerio.com> References: <438C24CE.2000200@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0907412348==" X-Trace: sea.gmane.org 1133270608 14131 80.91.229.2 (29 Nov 2005 13:23:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 29 Nov 2005 13:23:28 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Nov 29 14:23:16 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eh3Fl-0001bL-MG for gctc-ntg-context-518@m.gmane.org; Tue, 29 Nov 2005 12:02:30 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 43FC8127BD; Tue, 29 Nov 2005 12:02:29 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 21882-07-3; Tue, 29 Nov 2005 12:02:23 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5EBEE1280F; Tue, 29 Nov 2005 12:02:23 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5F9F61280F for ; Tue, 29 Nov 2005 12:02:22 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 21882-07-2 for ; Tue, 29 Nov 2005 12:02:21 +0100 (CET) Original-Received: from mx1.kerio.com (mx1.kerio.com [195.39.55.2]) by ronja.ntg.nl (Postfix) with ESMTP id EC91A127BD for ; Tue, 29 Nov 2005 12:02:20 +0100 (CET) Original-Received: from 192.168.10.80 ([192.168.10.80]) by mx1.kerio.com (Kerio MailServer 6.1.2) for ntg-context@ntg.nl; Tue, 29 Nov 2005 12:02:19 +0100 Original-To: mailing list for ConTeXt users In-Reply-To: <438C24CE.2000200@wxs.nl> X-Mailer: Kerio MailServer 6.1.2 WebMail X-User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:23918 Archived-At: This is a multi-part message in MIME format. --===============0907412348== Content-Type: multipart/alternative; boundary="----------peace-on-earth-f05653e41681c467fb3377e3a1618868" This is a multi-part message in MIME format. ------------peace-on-earth-f05653e41681c467fb3377e3a1618868 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks, Hans! One's still learning... =20 R. =20 =5F=5F=5F=5F=5F =20 From: Hans Hagen [mailto:pragma@wxs.nl] To: mailing list for ConTeXt users [mailto:ntg-context@ntg.nl] Cc: graumann@its.caltech.edu Sent: Tue, 29 Nov 2005 10:52:14 +0100 Subject: Re: [NTG-context] ConTeXt, XML, multiple attributes evaluation Richard Gabriel wrote: > Hello Johannes, > > I consider your first \XMLifequalelse command a bit strange. This=20 > command is intented to be used if you want to convert the attribute=20 > values into something else (e.g. "yes" into "packed"). > If you need the unmodified parameter value, simply use \XMLpar. > So e.g.: > > \startitemize[ \XMLpar{list}{setup}{},=20 > \XMLifequalelse{list}{packed}{yes}{packed}{unpacked} ] > > Of course "setup" should be a required attribute of (in your=20 > DTD), otherwise it would lead to something like \startitemize[,packed]= =20 > which obviously wouldn't work at all. > If it's not the case, I'd use \doifXMLparelse: > > \doifXMLparelse{list}{setup}{% > \startitemize[ \XMLpar{list}{setup}{},=20 > \XMLifequalelse{list}{packed}{yes}{packed}{unpacked} ]% > }{% > \startitemize[1, \XMLifequalelse{list}{packed}{yes}{packed}{unpacked= } ] > } > > > -Richard > > > ------------------------------------------------------------------= ------ > *From:* Johannes Graumann [mailto:graumann@caltech.edu] > *To:* ntg-context@ntg.nl > *Sent:* Tue, 29 Nov 2005 05:30:25 +0100 > *Subject:* [NTG-context] ConTeXt, XML, multiple attributes evaluat= ion > > Hello again, > > Another one: > I'm trying to expand > >\defineXMLenvironment [list]% > > {% > > \expanded{% > > \startitemize% > > [% > > \XMLifequalelse{list}{packed}{yes}{packed}{unpacked}% > > ]% > > }% > > }% > > {\stopitemize} > > which can deal with things like > > > > > > > > > > To something able to deal with multiple attributes (a "setup" > statement for > now): > > > > > > > > > > I have tryed multiple incarnations of > >\defineXMLenvironment [list]% > > {% > > \expanded{% > > \startitemize% > > [% > > \XMLifequalelse{list}{setup}{n}{n}{},% > > \XMLifequalelse{list}{packed}{yes}{packed}{unpacked}% > > ]% > > }% > > }% > > {\stopitemize} > > but this doesn't work ... > > Can anybody give me any pointers here=3F > a convenient way is to use the remapper: \mapXMLvalue {list:packed} {yes} {packed} \mapXMLvalue {list:packed} {no} {unpacked} and then: \defineXMLenvironment [list] [packed=3Dno] {\startitemize[\XMLval{list:packed}{\XMLop{packed}}{}]} {\stopitemize} no fuzzy testing involved, just expansion (fast and clean) Hans =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context =20 ------------peace-on-earth-f05653e41681c467fb3377e3a1618868 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks, Hans! One's still learning...

R.


From: Hans H= agen [mailto:pragma@wxs.nl]
To: mailing list for ConTeXt users= [mailto:ntg-context@ntg.nl]
Cc: graumann@its.caltech.edu
<= b>Sent: Tue, 29 Nov 2005 10:52:14 +0100
Subject: Re: [NTG-= context] ConTeXt, XML, multiple attributes evaluation

Ric= hard Gabriel wrote:

> Hello Johannes,
>
> I consid= er your first \XMLifequalelse command a bit strange. This
> comma= nd is intented to be used if you want to convert the attribute
> = values into something else (e.g. "yes" into "packed").
> If you ne= ed the unmodified parameter value, simply use \XMLpar.
> So e.g.:<= br>>
> \startitemize[ \XMLpar{list}{setup}{},
> \XMLifeq= ualelse{list}{packed}{yes}{packed}{unpacked} ]
>
> Of course= "setup" should be a required attribute of <list> (in your
>= ; DTD), otherwise it would lead to something like \startitemize[,packed]=
> which obviously wouldn't work at all.
> If it's not the = case, I'd use \doifXMLparelse:
>
> \doifXMLparelse{list}{set= up}{%
> \startitemize[ \XMLpar{list}{setup}{},
> \XMLifeq= ualelse{list}{packed}{yes}{packed}{unpacked} ]%
> }{%
> \s= tartitemize[1, \XMLifequalelse{list}{packed}{yes}{packed}{unpacked} ]> }
>
>
> -Richard
>
>
> ---= ---------------------------------------------------------------------> *From:* Johannes Graumann [mailto:graumann@caltech.edu]
> *To:* ntg-context@ntg.nl
> *Sent:* Tue, 29= Nov 2005 05:30:25 +0100
> *Subject:* [NTG-context] ConTeXt, X= ML, multiple attributes evaluation
>
> Hello again,
&= gt;
> Another one:
> I'm trying to expand
> = >\defineXMLenvironment [list]%
> > {%
> >= \expanded{%
> > \startitemize%
> > [%
>= > \XMLifequalelse{list}{packed}{yes}{packed}{unpacked}%
> = > ]%
> > }%
> > }%
> > {\s= topitemize}
>
> which can deal with things like
> = ><list packed=3D"yes">
> > <item>
>= ; > </item>
> ></list>
>
> = To something able to deal with multiple attributes (a "setup"
>= statement for
> now):
> ><list packed=3D"= yes" setup=3D"n">
> > <item>
> > <= /item>
> ></list>
>
> I have tryed= multiple incarnations of
> >\defineXMLenvironment [list]%<= br>> > {%
> > \expanded{%
> > \start= itemize%
> > [%
> > \XMLifequalelse{list}{setu= p}{n}{n}{},%
> > \XMLifequalelse{list}{packed}{yes}{packed}= {unpacked}%
> > ]%
> > }%
> > }%<= br>> > {\stopitemize}
>
> but this doesn't wor= k ...
>
> Can anybody give me any pointers here=3F
&g= t;

a convenient way is to use the remapper:

\mapXMLvalue {= list:packed} {yes} {packed}
\mapXMLvalue {list:packed} {no} {unpacked= }

and then:

\defineXMLenvironment
[list]
[packed= =3Dno]
{\startitemize[\XMLval{list:packed}{\XMLop{packed}}{}]}
= {\stopitemize}

no fuzzy testing involved, just expansion (fast a= nd clean)

Hans
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl= /mailman/listinfo/ntg-context
------------peace-on-earth-f05653e41681c467fb3377e3a1618868-- --===============0907412348== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context --===============0907412348==--