From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/23913 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: ConTeXt, XML, multiple attributes evaluation Date: Tue, 29 Nov 2005 10:52:14 +0100 Message-ID: <438C24CE.2000200@wxs.nl> References: <20051129073445.f17b7ec5@mx1.kerio.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1133261598 18364 80.91.229.2 (29 Nov 2005 10:53:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 29 Nov 2005 10:53:18 +0000 (UTC) Cc: graumann@its.caltech.edu Original-X-From: ntg-context-bounces@ntg.nl Tue Nov 29 11:52:45 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 1Eh29x-00017x-42 for gctc-ntg-context-518@m.gmane.org; Tue, 29 Nov 2005 10:52:26 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9F050128CD; Tue, 29 Nov 2005 10:52:24 +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 21167-04; Tue, 29 Nov 2005 10:52:20 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7CF71128A5; Tue, 29 Nov 2005 10:52:20 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 43A59128A5 for ; Tue, 29 Nov 2005 10:52:19 +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 21318-01 for ; Tue, 29 Nov 2005 10:52:18 +0100 (CET) Original-Received: from controller-1 (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with ESMTP id 2B63F12809 for ; Tue, 29 Nov 2005 10:52:17 +0100 (CET) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 5510 for multiple; Tue, 29 Nov 2005 10:57:12 +0300 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <20051129073445.f17b7ec5@mx1.kerio.com> X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 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:23913 Archived-At: Richard Gabriel wrote: > Hello Johannes, > > I consider your first \XMLifequalelse command a bit strange. This > command is intented to be used if you want to convert the attribute > 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}{}, > \XMLifequalelse{list}{packed}{yes}{packed}{unpacked} ] > > Of course "setup" should be a required attribute of (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}{setup}{% > \startitemize[ \XMLpar{list}{setup}{}, > \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 evaluation > > 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? > a convenient way is to use the remapper: \mapXMLvalue {list:packed} {yes} {packed} \mapXMLvalue {list:packed} {no} {unpacked} and then: \defineXMLenvironment [list] [packed=no] {\startitemize[\XMLval{list:packed}{\XMLop{packed}}{}]} {\stopitemize} no fuzzy testing involved, just expansion (fast and clean) Hans