Klocker Christoph wrote:
> I have this structure
> 
> <numbered_list>
>       <list_numbering></listnumbering>
>       <entry>
>               <absatz>STRING<absatz>
>        </entry>
> </numbered_list>
> 
> I try to achieve a command that inserts me a new <listnumbering> and a
> new <entry> as both are required, after the previous one. The carriage
> is positioned at the "STRING."
> 
>       <list_numbering></listnumbering>
>       <entry>
>               <absatz><absatz>
>        </entry>
> 
> the result should be this:
> 
> <numbered_list>
>       <list_numbering>1.1</listnumbering>
>       <entry>
>               <absatz>STRING<absatz>
>        </entry>
>       <list_numbering></listnumbering>
>       <entry>
>               <absatz><absatz>
>       </entry>
> </numbered_list>
> 
> 
> I got it working when the list_numbering is an attribute, with the
> insertNode command.

You need to write a *macro-command* for that. See 
http://www.xmlmind.com/xmleditor/_distrib/docs/commands/ch02.html

Something like:
---
   <command name="insertNumberedEntry">
     <macro>
       <sequence>
         <command name="selectNode"
                  parameter="ancestorOrSelf[implicitElement] entry"/>

         <command name="paste"
                  parameter="after <?xml 
version='1.0'?><list_numbering></listnumbering><entry><absatz><absatz></entry>"/>
       </sequence>
     </macro>
   </command>
---

Note that:
* I've not tested the above macro.
* You'll need to replace "<" by "&lt;" and ">" by "&gt;" in the 
parameter of the paste command.

See http://www.xmlmind.com/xmleditor/_distrib/docs/commands/ch06s53.html
See http://www.xmlmind.com/xmleditor/_distrib/docs/commands/ch06s35.html


Reply via email to