Huditsch, Roman (LNG-VIE) wrote:
>
> Good idea! The splitting works perfectly. But unfortunately I wasn't able to
> place the selected text between the end and open tags.
> Using "paste into" or "paste to" I just managed to insert it in the second
> inline element.
>
> Source with "is" selected:
> <starke-betonung>This is a text</starke-betonung>
>
> Should get
> <starke-betonung>This </starke-betonung>is<starke-betonung> a
> text</starke-betonung>
>
> But with "paste" I just get
> <starke-betonung>This </starke-betonung><starke-betonung>is a
> text</starke-betonung>
>
> I also tried to move the caret with "moveDotTo" but with no success either.
>
What follows a macro recorded by XXE's macro recorder (that is,
Tools|Macro menu) which shows how this could be done.
Before recording the macro I've just selected a word in the middle of an
XHTML <b> element. Should work the same in the case of your custom schema.
<command name="COMMAND_NAME_HERE"
xmlns="http://www.xmlmind.com/xmleditor/schema/configuration">
<macro undoable="true"
repeatable="false"
trace="false">
<sequence>
<command name="cut"
parameter="[implicitElement]"/>
<command name="selectNode"
parameter="parentOrNode"/>
<command name="selectNode"
parameter="parentOrNode"/>
<command name="split"/>
<command name="selectNode"
parameter="parentOrNode"/>
<command name="selectNode"
parameter="parentOrNode"/>
<command name="paste"
parameter="before[implicitElement]"/>
</sequence>
</macro>
</command>