Author mode: cut (and paste) XML

Are you missing a feature? Request its implementation here.
ra0543
Posts: 80
Joined: Wed Jan 14, 2009 12:50 pm

Author mode: cut (and paste) XML

Post 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.
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author mode: cut (and paste) XML

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
kwringe
Posts: 10
Joined: Thu Jun 18, 2009 9:30 pm

Re: Author mode: cut (and paste) XML

Post 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
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author mode: cut (and paste) XML

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
kwringe
Posts: 10
Joined: Thu Jun 18, 2009 9:30 pm

Re: Author mode: cut (and paste) XML

Post by kwringe »

That is fantastic!!
ra0543
Posts: 80
Joined: Wed Jan 14, 2009 12:50 pm

Re: Author mode: cut (and paste) XML

Post 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?
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Author mode: cut (and paste) XML

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
ra0543
Posts: 80
Joined: Wed Jan 14, 2009 12:50 pm

Re: Author mode: cut (and paste) XML

Post by ra0543 »

That is absolutely brilliant! Thank you.
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Author mode: cut (and paste) XML

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
ra0543
Posts: 80
Joined: Wed Jan 14, 2009 12:50 pm

Re: Author mode: cut (and paste) XML

Post 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.)
jorusso
Posts: 4
Joined: Fri Jul 20, 2012 1:05 am

Re: Author mode: cut (and paste) XML

Post 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.
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Author mode: cut (and paste) XML

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Martin de la Iglesia
Posts: 19
Joined: Tue Aug 22, 2017 5:43 pm

Re: Author mode: cut (and paste) XML

Post 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.
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author mode: cut (and paste) XML

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author mode: cut (and paste) XML

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply