[NTG-context] Re: ConTeXt, XML, multiple attributes evaluation

Johannes Graumann graumann at caltech.edu
Tue Nov 29 20:58:14 CET 2005


Taco Hoekwater wrote:

>> but this doesn't work ...
> 
> But it worked fine for me!?
Well, ... if I actually use the "setup" assignment in the list tag rather
than an item tag it works for me as well ... ;0)
 
> Anyway, it is probably a better idea to do it like this:
> 
> \defineXMLenvironment [list]%
>   {%
>    \let\listoptions\empty
>    \XMLifequalelse{list}{setup}{n}
>        {\appendtocommalist{n}\listoptions}
>        {}%
>    \XMLifequalelse{list}{packed}{yes}
>        {\appendtocommalist{packed}\listoptions}
>        {\appendtocommalist{unpacked}\listoptions}%
>    \expanded{%
>     \startitemize[\listoptions]%
>    }%
>   }%
>   {\stopitemize}
> 
> 
> Because that way, the xml attributes can be optional.
> If it still doesn't work, please explain what goes wrong.
Thanks so mutch for this! Do you see any way of generalizing the
"XMLifequalelse{list}{setup}{n}" part? Could I just have the argument of
"<list setup="whatever">" handed thtough to ConTeXt rather than writing
if-loops for n,a,A,KA,r,R,KR,m,g,G,1,2,3,4,5,6,7,8?

Thanks for your 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. California Blvd.                                        |
|      Pasadena, CA 91125                                              |
|      USA                                                             |
+----------------------------------------------------------------------+



More information about the ntg-context mailing list