Page 1 of 1

Author mode: cut (and paste) XML

Posted: Thu May 06, 2010 5:24 pm
by ra0543
For collaborative working it would be handy to have commands in author mode that cut and paste the underlying XML: the idea would be that it would be possible, say, to select a chunk of marked up text in author mode and have the option to cut/copy it to the clipboard including its XML mark-up (both tags and attributes), e.g. so it could then be pasted into another application (e.g. an e-mail to a colleague).

Conversely, it would be good then to be able to reverse the process, i.e. cut a chunk of well-formed XML from another source, e.g. an e-mail, and paste it directly into a document open in author mode so that the tags and attributes are recognised.

Re: Author mode: cut (and paste) XML

Posted: Thu May 06, 2010 5:42 pm
by Radu
Hi,

I added the first request (copy as XML from the Author) to our internal issues list and it will be discussed.
As for the second request (paste XML text in Author), it is already available, just right click in the Author and "Paste as XML".
By default the XML text is pasted as escaped (useful when you have programlistings or code sections for example).

Regards,
Radu

Re: Author mode: cut (and paste) XML

Posted: Thu Jul 08, 2010 10:30 pm
by kwringe
On our team, we REALLY like the ability to copy and paste text from Author mode and paste the content as text. We find this feature to very useful because it allows us to quickly copy and paste content we are working on and send the content to other to review. Our XML editor copied the underlying XML along with the content and it was tedious removing all the tagging.

Perhaps there might be a way to customize the copy feature in Author so that it supported copying the text and copying the text plus XML.

Thank you,
Kate

Re: Author mode: cut (and paste) XML

Posted: Fri Jul 09, 2010 9:35 am
by Radu
Hi Kate,

The default copy operation will continue to copy only the text content from the Author page.
If the "Copy as XML" gets implemented it will probably get implemented as a new action available in the contextual menu.

Regards,
Radu

Re: Author mode: cut (and paste) XML

Posted: Fri Jul 09, 2010 5:54 pm
by kwringe
That is fantastic!!

Re: Author mode: cut (and paste) XML

Posted: Wed Nov 17, 2010 1:50 pm
by ra0543
I can see the need for this functionality becoming increasing urgent among my colleagues. Is there any easy workaround (i.e. one that doesn't involve having to go into Text view) that anyone can suggest for the time being, e.g. a custom action or something that I could set up? I have no expertise in Java etc. but I could follow a set of instructions to set something up. Or will this be in the next release of Oxygen and if so, when will that be?

Re: Author mode: cut (and paste) XML

Posted: Thu Nov 18, 2010 6:49 pm
by adrian
Hello,

This feature hasn't been implemented yet so it won't make it in the next version, v12.1.

However, this is very easy to implement as a custom Author operation with the Author SDK.

We'll have a JAR file and the configuration procedure ready for you by tomorrow.

Regards,
Adrian

Re: Author mode: cut (and paste) XML

Posted: Thu Nov 18, 2010 11:16 pm
by ra0543
That is absolutely brilliant! Thank you.

Re: Author mode: cut (and paste) XML

Posted: Fri Nov 19, 2010 7:04 pm
by adrian
Hello,

Download the zip archive that contains the jar and source file for the custom operation here:
http://www.oxygenxml.com/forum/files/copyXML.zip

To use this, go to Options -> Preferences -> Document Type Association and edit/duplicate the document type used in your XML documents.

1. In the Document type editing dialog go to the Classpath tab and add the copyXML.jar from the archive.

2. Go to the Author tab and select Actions from the list on the left. Add a new action(+ button) and fill the fields as follows:
ID: copyXML
Name: Copy as XML
Leave the other fields empty.

3. Press the Choose button from the Operations section and in the Operation dialog choose the CopyXMLOperation from the Class list, it should be the last item.
Close with OK the dialogs until back to Document type dialog.

4. Select the Contextual menu item from the left list. Select the Copy as XML action from the left list of available actions and the Contextual menu root from the right tree of current actions. Press the upper button located between the two lists(Add as child). This should add the action as the first in the contextual menu. OK in all dialogs.

5. Open a document of that type in Author mode, select something in the editor and invoke the contextual menu. You should find the Copy as XML action just under Paste as XML.


Give it a go and see if it works as expected. Paste as XML should do the opposite and allow the XML snippet to be placed back in the document.

Regards,
Adrian

Re: Author mode: cut (and paste) XML

Posted: Mon Nov 22, 2010 2:16 pm
by ra0543
Thank you!! That works perfectly, although I had to set up a document type to use it because I couldn't see a built-in generic XML document type (but I may have overlooked one). (I haven't made any use of document types before, as all my schema & stylesheets are declared in my XML documents.)

Re: Author mode: cut (and paste) XML

Posted: Fri Jul 20, 2012 1:12 am
by jorusso
Is the zip file that adrian posted still available? I've been searching for the same solution.

Also, I'd really like to see this added as a standard option. I can't imagine that the three of us in this thread are the only ones who need this functionality.

Re: Author mode: cut (and paste) XML

Posted: Fri Jul 20, 2012 4:12 pm
by adrian
Hi,

I've re-uploaded the file, this time in the forum, so it should be persistent:
Download copyXML.zip

I'll add your vote for this feature request. We did have a few other requests for this and obviously the problem is not the implementation. However, we are worried that the default user interface that we offer is becoming more and more cluttered and confusing by adding all these actions. This is especially true from the perspective of the content authors that aren't XML-savy.

But, I guess the least we could do is provide this as a standard operation, so all you'd have to do is configure the document type and add it to the user interface.

Regards,
Adrian

Re: Author mode: cut (and paste) XML

Posted: Mon Jun 22, 2020 2:00 pm
by Martin de la Iglesia
Has this feature been implemented as a standard operation yet? I am aware that this thread is quite old, but I am looking for a copy/cut/paste XML operation in Author mode and haven't found one.

Re: Author mode: cut (and paste) XML

Posted: Tue Jun 23, 2020 7:00 am
by Radu
Hi Martin,

For now we have a "Paste as XML" but we do not yet have "Copy as XML". I will try to increase the priority on the opened issue and update this thread when a new Oxygen version with the required action is available.
In the meantime the workaround is to create your own Author custom action with the steps and the library that Adrian provided.

Regards,
Radu

Re: Author mode: cut (and paste) XML

Posted: Fri Nov 20, 2020 1:29 pm
by Radu
Hi,

We just released Oxygen 23 and it comes with a "Copy as XML" action for the Author visual editing mode located in the main menu "Document->Edit" submenu.

Regards,
Radu