Am 16.06.2012 um 14:11 schrieb Meer, H. van der: > In order to be able to use attributes on xml-nodes freely, the following > situations can arise: > > The foregroundcolor parameter gets a value: > <node color="red"> correctly sets ..[foregroundcolor=\xmlatt{#1}{color}] > color to red. > > However, in the next case the current foregroundcolor should be left as is, > but reverts to black: > <node> ..[foregroundcolor=] and is apparently reset to the general default.
When you write “foregroundcolor=” you apply *nothing* to the key and the last setting is changed. > trying the following seemed the solution, but it does not work: > ..[\doifnot{\xmlatt{#1}{color}}{\empty}{foregroundcolor=\xmlatt{#1}{color}}] > giving in the log: > {foregroundcolor=orange}' in line 16 (249>:) > check > missing or ungrouped '=' after '\doifnot {}{} > > Putting the above \doif inside an \expanded{} does not alter the behaviour. > > How to accomplish leaving the parameter as is for an absent attribute? You can try “\expdoifnot{\xmlatt{#1}{color}}{}{backgroundcolor=\xmlatt{#1}{color}}” but I can’t say for sure without a example. Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________