John L. Clark wrote:
> The behavior that I am witnessing for the Open as Template functionality
> does not seem to be what it should.  The version 2.4p1 documentation
> says that "[a] copy of [the] existing XML document will be emptied to
> serve as the skeleton of your new document" (section 3.2).  It goes on
> to suggest trying the command using userguide.xhtml or userguide.xml.
> The first produces a simple document with a placeholder for a title and
> an empty body, and the second produces an article with just a paragraph.
> I was expecting the document structures to be maintained intact, with
> only the content (that is, PCDATA) stripped out (and, I would suppose,
> element attributes).  Should I not have expected that?  It would be very
> useful to be able to reuse old documents as templates for new ones in
> this fashion.

"Open as Template" works as expected (i.e. there is no bug here).

It creates a new document by copying:
* the <!DOCTYPE>,
* the top level comments and processing-instructions,
* the root element,
of an existing document.

If needed too, it will also add children to the copy of the root element 
to make the new document valid.

We think that this behavior is useful too, especially when a user has 
not taken the time to write an XXE configuration for a class of documents.

You seem to be missing:
* a "Select All" [text] command
* an "Erase" command which just delete the characters contained in the 
selection (but not the nodes).

We agree that these commands would be useful from time to time.


Reply via email to