Robert Ganowski wrote:
> I have a rather little problem with moving a part of document, I'm editing, 
> to 
> an external file, for inserting it next back as reference. 
> I'm starting to edit a DocBook document, let say <book> with <chapters>. I 
> give my chapter a <title> value, an @id attribute value, and other content. 
> Finally I'd like to have this chapter saved as an independent file. I create 
> a new file based on chapter template, cut the original <chapter> from <book> 
> and try to paste it into this new file. And I cannot. So I do the job in a 
> few steps: 
> 1) copy and paste the title, 
> 2) copy and paste @id attribute, 
> 3) copy and paste the rest of the content. 
> The rest (saving, copying as reference, pasting) is easy and well known. But 
> what am I doing wrong, that I can't move a <chapter> to a newly created 
> <chapter> own file? 

XXE does not support replacing the root element of a document.

In your case, this means that you cannot paste the chapter element cut
from the book file onto the blank chapter element which is the root
element of the  independent file.

But you can copy and paste all the child elements of the chapter at
once. Here's how:

[1] Select the chapter to be cut.
[2] Type Esc, then press Down Arrow. All the child elements of the
chapter are selected.
[3] Ctrl-C to copy all these child elements to the clipboard.
[4] Create a new chapter document.
[5] Select its chapter root element, then type Esc Down Arrow to select
all its children (a title and a para).
[6] Ctrl-V to paste all copied child elements at once.

---
PS: Of course, the whole operation (up to replacing the chapter by a
reference found in a file of its own) could be automated by writing the
proper macro. If you are interested, just ask.


Reply via email to