Hi Hussein, As usual, your solution works fine.
Thanks a lot, Lionel Hussein Shafie a ecrit le 17/10/06 10:01: > Lionel Barth wrote: > >> I am trying to create a binding to wrap or unwrap text to be checked >> later using the following : >> >> <binding> >> <keyPressed code="R" modifiers="mod" /> >> <command name="wrapUnwrap" /> >> </binding> >> >> <command name="wrapUnwrap"> >> <macro> >> <choice> >> <command name="wrap" parameter="[implicitElement] toCheck"/> >> <command name="wrap" parameter="[implicitElement] #text"/> >> </choice> >> </macro> >> </command> >> >> This works fine, but if another element was in the selection (for >> instance something like italic or bold), unwrapping looses the included >> element, because of the '#text' parameter. >> >> > > Yes, but you cannot use "wrap #text" for that. You need to use this > sequence: > > [1] Select all the nodes of the element to be unwrapped, for example > using "selectNode children[implicitElement]" > http://www.xmlmind.com/xmleditor/_distrib/doc/commands/selectNode.html > > [2] Copy these nodes to the clipboard using "copy". > > [3] Select the the element to be unwrapped, for example using > "selectNode parent". > > [4] Replace the the element to be unwrapped using "paste to". > > > > --- > PS: Easy way to do that: record a macro doing this and paste the text > displayed by "Tools|Record Macro|View" (this is what I did): > > ([0]=Ctrl-Up, Ctrl-Up, to explicitly select the element to be unwrapped) > [1]=Esc Down > [2]=Ctrl-C > [3]=Ctrl-Up > [4]=Ctrl-V > > This gives me: > --- > <command name="COMMAND_NAME_HERE" > xmlns="http://www.xmlmind.com/xmleditor/schema/configuration"> > <macro undoable="true" > repeatable="false" > trace="false"> > <sequence> > <command name="selectNode" > parameter="parentOrNode"/> > <command name="selectNode" > parameter="parentOrNode"/> > <command name="selectNode" > parameter="children[implicitElement]"/> > <command name="copy" > parameter="[implicitElement]"/> > <command name="selectNode" > parameter="parentOrNode"/> > <command name="paste" > parameter="toOrInto"/> > </sequence> > </macro> > </command> > --- > > -- > XMLmind XML Editor Support List > xmleditor-support at xmlmind.com > http://www.xmlmind.com/mailman/listinfo/xmleditor-support >

