NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Thys on May 04, 2017, 03:36:06 AM
-
Hi,
Just wondering if there is an easy way to convert from JSON to XML and vice versa? Should probably be methods within jfiles and xfiles.
Thys
-
it's an intriguing idea,
are you thinking of a "known" structure, or "any" structure?
cheers
Bruce
-
try with demo of easyxml http://www.ingasoftplus.com/Downloads.php?ProductID=293
-
Hi Bruce.
Both jFiles and xFiles work from the premise on the one side to have a fixed Clarion data structure, and on the other side the formatted text structure - and the class methods assist to convert from the one structure to the other. But with this I think it would be (for example) an XML object being created from a JSON object's method - and vice versa, so there should be no need for a Clarion structure to do the conversion.
Thys
-
try with demo of easyxml http://www.ingasoftplus.com/Downloads.php?ProductID=293
Thanks, I'll have a look at it.
-
If both had an interim "format free" state then yes, you are right, it should be possible.
jFiles does have such a state, but alas xFiles does not.
So it would be relatively easy to create xml from Json - simply by adding an output method to jFiles so save the interim state to xml instead of json.
In practice everyone would want waaay too much control over the xml - this should be an attribute, that should be a field, and so on.
I'm sure there are tools to do this, but it's not a road I have a need to go down <g>.
cheers
Bruce