toggle JSON escaped chars?

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
mhGLEIF
Posts: 42

toggle JSON escaped chars?

Mon Apr 24, 2017 10:40 am

Dear oxygen team,

I have some JSON files that include xml strings within them.

To conform to JSON the XML strings have been heavily escaped.

How can I quickly and conveniently toggle back and forth between JSON-escaped string and XML string, so that I can edit as XML and/JSON?
adrian
Posts: 2443

Re: toggle JSON escaped chars?

Mon Apr 24, 2017 10:58 am

Hi,

The JSON editor from Oxygen does not have specialized actions in this regard. It is however possible to do this with the help of an XML document, since the XML editor that can easily escape/unescape chars.
What you can do is:
1. In the JSON document select and copy to clipboard the escaped XML content.
2. Create a new XML document (File > New > XML) and paste the escaped XML content there.
3. In the XML document, select all the escaped XML content, right click on the selection and use the action Source > Unescape Selection... (make sure the appropriate options are checked)
4. In the XML document, edit as XML as you like.
5. When/If you want to put it back in the JSON document, select the entire content you need in the XML document and use the action Source > Escape Selection...
6. Copy the escaped content from the XML document and put it back in the JSON document.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
mhGLEIF
Posts: 42

Re: toggle JSON escaped chars?

Thu Apr 27, 2017 3:42 pm

Thanks Adrian,

the problem is that the escape characters work for JSON, not XML - they are not XML entities, but JSON "entities" like

Code: Select all

",{}[]
.

I guess that oxygen doesn't do JSON excaping?
adrian
Posts: 2443

Re: toggle JSON escaped chars?

Thu Apr 27, 2017 5:33 pm

Hi,

No, there is no JSON escaping in Oxygen. Only XML-escaping.

I've logged a feature request for this (JSON escaping) on our issue tracking tool. For reference it is issue EXM-39319.
We will notify this thread when it is implemented.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
adrian
Posts: 2443

Re: toggle JSON escaped chars?

Fri Apr 28, 2017 5:24 pm

Hi,

Our developers are asking for an example for this (with and without escaping). Could you please provide one?

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 1 guest