John L. Clark wrote: > I have a fairly straightforward enhancement request: copy-as-text. Some > document editors offer functionality such as "Copy special", which can > be used to save the current selection in the clipboard in a different > format. My users, in particular, have been asking for the capability of > copying just the textual content of the current selection for pasting > into other contexts. > > For example, if, given the following document - > > --- > <section><title>Some title</title><para>Hello. And hello > again.</para></section> > --- > > - the user had selected from "Some" through "Hello." and wanted to just > copy that text, the clipboard should hold the following - > > --- > Some title > > Hello. > ---
OK, we'll add such command in next release. (It is too late for V3.) We, here at XMLmind, as extensive users of XXE, daily copy and paste plain text from XHTML to DocBook and vice-versa. Here's how we do it: [1] Use Options|Options, Edit section and check "Clicking with middle button pastes system selection". [2] Teach your users that they can select text as usual, and if they want to paste text only, they simply have to click on the middle button/scroll wheel. No, there are no need to copy the text to clipboard using something like Alt-Ctrl-C. Simply select the text across elements and directly paste it where you want by clicking on the middle button/scroll wheel. Unix users are familiar with this way of doing things. Windows and Mac are not. However, this is so handy that we have made this feature available on all the platforms. Moreover on Linux (that is, Generic Unix/X-Window), it also works between XXE and the other applications, which makes this feature even more attractive. > I tried to implement this using an XSLT script to extract the text > content of a document, but I could not find a way to copy the system > clipboard to a document for conversion within a process command. There > is the "selection" attribute of the "copyDocument" element, but that > does not allow one to access arbitrary user selections. > > If there is a way to apply a "transform"ing process command to the > clipboard (populated using the "copyToClipboard" command), then that > would be sufficient for what I am trying to do (and powerful enough for > a great deal more). If not, then I humbly submit a feature request > either to be able to copy clipboard contents to a file within the > context of a process command (<cfg:copyContent/>?) or for XXE to > internally implement a copy as text feature or even a more powerful > (possibly even configurable) "Copy special" feature. All this seems pretty complicated. > I suppose while I'm going one direction, I may as well ask for a "Paste > special" feature. It would be very cool to be able to paste xhtml > content into a DocBook file, using some configuration magic > behind-the-scenes to apply an XSLT transform to that clipboard contents > to produce the necessary DocBook (or any particular XML application). Remember that you can do anything you want by writing a custom command in Java[tm]. Writing a custom command is not very hard (forget about XSLT and use XXE DOM), less hard than many things you have already done.

