Vitaly Harisov wrote:
>
> I have document with such structure:
>
> <section id='sec1'>
> <section id='sec2'>
> <para>para1</para>
> </section>
> <section id='sec3'>
> <para>para1</para>
> </section>
> </section>
>
> I want to replace sec2 with its content:
>
> <section id='sec1'>
> <para>para1</para>
> <section id='sec3'>
> <para>para1</para>
> </section>
> </section>
>
> Is this possible to do with xxe not using copy'n'paste method
> (copy sec2 content to buffer, remove sec2, paste buffer before sec3)?
Yes, you simply need to *automate* the copy'n'paste method using a
macro-command.
Writing such macro-command is easy because your sections do not seem to
have a mandatory title (which would need to be discarded by the macro).
Here it is:
---
<command name="FlattenSection">
<macro>
<sequence>
<command name="selectNode"
parameter="ancestorOrSelf[implicitElement] section"/>
<command name="selectNode" parameter="children"/>
<command name="copy" />
<command name="selectNode" parameter="parent"/>
<command name="paste" parameter="to" />
</sequence>
</macro>
</command>
<binding>
<keyPressed code="F5" />
<command name="FlattenSection" />
</binding>
---
* To quickly test the above macro, copy attached customize.xxe to
<XXE_user_preferences_dir>/config/. XXE_user_preferences_dir is
C:\Documents and Settings\<user>\xxe2\ on Windows and ~/.xxe2/ on Linux.
* Restart XXE.
* Then click anywhere inside the section to be flattened and press F5.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: customize.xxe
Type: text/xml
Size: 775 bytes
Desc: not available
Url :
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20041029/68b1419b/attachment.xml