Hi Hussein, Thank you very much for your help :) It actually works fine now.
I know that my commands seem to be a bit overly complex, but I haven't yet found out how to reuse variables within a parameter attribute. Therefore I am <cfg:get>ing the appropriate variable and pass it the the parameter attribute as "%_". Is that the way it should work? I also tried something like parameter="$var" but with no sucess. wbr, Roman > -----Urspr?ngliche Nachricht----- > Von: Hussein Shafie [mailto:hussein at pixware.fr] > Gesendet: Mittwoch, 23. Februar 2005 13:15 > An: Huditsch Roman > Cc: xmleditor-support at xmlmind.com > Betreff: Re: [XXE] if - then - else > > Huditsch Roman wrote: > > I am in search for a simple if - then - else command sequence. > > Reading your documentation I could not figure it out myself. > > I tried several code constructs with <choice> and <test> > but nothing worked. > > > > I would just like to test, if a variable's text is set to a > value other than "LexisNexis". > > If that is true, a new attribute should be inserted with > the appropriate value. > > > > <!-- IF ($foo:autor!='LexisNexis)--> > > <cfg:command name="pick" parameter="Kodex false AVG BR HR StrR VfR > > WohnG ZGV"/> <cfg:set variable="kodex" expression="%_" > > plainString="true"/> <cfg:get expression="$kodex"/> <cfg:command > > name="putAttribute" parameter="kodex %_"/> > > <!-- ELSE --> > > ... > > --- > <cfg:choice> <!--IF--> > <cfg:sequence> > <cfg:test expression="$foo:autor!='LexisNexis'" > xmlns:foo="http://www.xmlmind.com/xmleditor/namespace/scope/vi > ew"/><!--TEST--> > > <cfg:command name="pick" > parameter="Kodex false AVG BR HR StrR VfR WohnG > ZGV"/><!--THEN--> > <cfg:command name="putAttribute" parameter="kodex %_"/> > </cfg:sequence> > > <cfg:sequence><!--ELSE--> > [...] > </cfg:sequence> > </cfg:choice> > --- > > And, if this does not not work, a possible reason would be > that ``global to the document view''-variable "$foo:autor" > has not been initialized by another macro-command. > > > > > --- > PS: Your macro-commands seem to be often unnecessarily complex. > For example, what follows is useless: > --- > <cfg:set variable="kodex" expression="%_" > plainString="true"/> <cfg:get expression="$kodex"/> > --- > >

