From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/23909 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 08:34:45 +0100 Message-ID: <20051129073445.f17b7ec5@mx1.kerio.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2111497277==" X-Trace: sea.gmane.org 1133250149 21986 80.91.229.2 (29 Nov 2005 07:42:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 29 Nov 2005 07:42:29 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Nov 29 08:42:19 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 1Eh00z-0004JZ-Rl for gctc-ntg-context-518@m.gmane.org; Tue, 29 Nov 2005 08:35:03 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id F179D127F7; Tue, 29 Nov 2005 08:35:00 +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 19563-01; Tue, 29 Nov 2005 08:34:54 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 914FD12805; Tue, 29 Nov 2005 08:34:54 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id AC8D912805 for ; Tue, 29 Nov 2005 08:34:53 +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 19414-06 for ; Tue, 29 Nov 2005 08:34:52 +0100 (CET) Original-Received: from mx1.kerio.com (mx1.kerio.com [195.39.55.2]) by ronja.ntg.nl (Postfix) with ESMTP id 4E777127F7 for ; Tue, 29 Nov 2005 08:34:52 +0100 (CET) Original-Received: from 192.168.10.80 ([192.168.10.80]) by mx1.kerio.com (Kerio MailServer 6.1.2) for graumann@its.caltech.edu; Tue, 29 Nov 2005 08:34:45 +0100 Original-To: graumann@its.caltech.edu, mailing list for ConTeXt users In-Reply-To: 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:23909 Archived-At: This is a multi-part message in MIME format. --===============2111497277== Content-Type: multipart/alternative; boundary="----------flower-power-801732ff9795f359b738e5d60362160f" This is a multi-part message in MIME format. ------------flower-power-801732ff9795f359b738e5d60362160f Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello Johannes, =20 I consider your first \XMLifequalelse command a bit strange. This com= mand 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.: =20 \startitemize[ \XMLpar{list}{setup}{}, \XMLifequalelse{list}{packed}{y= es}{packed}{unpacked} ] =20 Of course "setup" should be a required attribute of (in your D= TD), otherwise it would lead to something like \startitemize[,packed] w= hich obviously wouldn't work at all.=20 If it's not the case, I'd use \doifXMLparelse: =20 \doifXMLparelse{list}{setup}{% \startitemize[ \XMLpar{list}{setup}{}, \XMLifequalelse{list}{packed}= {yes}{packed}{unpacked} ]% }{% \startitemize[1, \XMLifequalelse{list}{packed}{yes}{packed}{unpacked= } ] } =20 =20 -Richard =20 =20 =5F=5F=5F=5F=5F =20 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=20 >\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 Thanks for time and help, Joh --=20 +----------------------------------------------------------------------+ | Johannes Graumann, Dipl. Biol. | | | | Graduate Student Tel.: ++1 (626) 395 6602 | | Deshaies Lab Fax.: ++1 (626) 395 5739 | | Department of Biology | | CALTECH, M/C 156-29 | | 1200 E. California Blvd. | | Pasadena, CA 91125 | | USA | +----------------------------------------------------------------------+ =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 ------------flower-power-801732ff9795f359b738e5d60362160f Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 <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}{setup}{%
  \startitemize[ \XMLpar{list}{setup}{}, \XMLifequalelse{list}{pack= ed}{yes}{packed}{unpacked} ]%
}{%
  \startitemize[1, \XMLifequalelse{list}{packed}{yes}{packed}{unpac= ked} ]
}


-Richard



From: Johann= es Graumann [mailto:graumann@caltech.edu]
To: ntg-context@ntg.= nl
Sent: Tue, 29 Nov 2005 05:30:25 +0100
Subject: [N= TG-context] ConTeXt, XML, multiple attributes evaluation

= Hello again,

Another one:
I'm trying to expand
>\define= XMLenvironment [list]%
> {%
> \expanded{%
> \starti= temize%
> [%
> \XMLifequalelse{list}{packed}{yes}{pac= ked}{unpacked}%
> ]%
> }%
> }%
> {\stopitemi= ze}

which can deal with things like
><list packed=3D"yes= ">
> <item>
> </item>
></list>
To something able to deal with multiple attributes (a "setup" state= ment for
now):
><list packed=3D"yes" setup=3D"n">
>= <item>
> </item>
></list>

I have t= ryed multiple incarnations of
>\defineXMLenvironment [list]%
&g= t; {%
> \expanded{%
> \startitemize%
> [%
>= ; \XMLifequalelse{list}{setup}{n}{n}{},%
> \XMLifequalelse= {list}{packed}{yes}{packed}{unpacked}%
> ]%
> }%
>= }%
> {\stopitemize}

but this doesn't work ...

Can a= nybody give me any pointers here=3F

Thanks for time and help,
=
Joh

--
+-------------------------------------------------= ---------------------+
| Johannes Graumann, Dipl. Biol. = |
| = |
| Graduate Student = Tel.: ++1 (626) 395 6602 |
| Deshaies Lab = Fax.: ++1 (626) 395 5739 |
| Department of Biology = |
| CALTECH, M/C 156-29= |
| 1200 E. Califor= nia Blvd. |
| Pasadena, C= A 91125 |
| USA = |
+---------= -------------------------------------------------------------+

= =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=5Fntg-context mailing list
ntg-c= ontext@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-conte= xt
------------flower-power-801732ff9795f359b738e5d60362160f-- --===============2111497277== 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 --===============2111497277==--