Getting JSON Output from WebWorks
Version |
Date |
Changes |
Author |
1.0 |
June 17, 2013 |
Initial version. |
Lief |
Description
Our Development team has a web-based UI behind which they want the context sensitive help in JSON. The oXygen Editor has built-in a XML-to-JSON conversion. I would like to use WebWorks to produce JSON rather than oXygen -- merely for a standardization purpose. The oXygen XML-to-JSON output is a one-to-one conversion; there is no conref or key resolution. In our view this is a deficiency -- one that we currently work around by not using conrefs or keys. A significant benefit of using ePublisher would be to have the DITA-OT resolve the conrefs and keys to produce the WIF file from which the final JSON would be produced.
I assume the proper format in WebWorks is XML + XSL, and it is the one I chose for this wiki project.
From what I can tell, these files (at a minimum) must be modified/added. I am not entirely sure how though:
- Adapters\xml\scripts\dita\ant\webworks-1.5.xml (to create a new target?)
- Transforms\xml-to-json.xsl
There is a publicly available XML-to-JSON XSL stylesheet here: http://www.bramstein.com/projects/xsltjson/ It can be included in any WebWorks stylesheet and used to convert XML to XSL.
Although specific to oXygen, this topic may be helpful in setting expectations for output (see what needs to be suppressed in the second bullet below): http://www.oxygenxml.com/forum/topic6852.html
I've included two JSON output files.
- source_files\json_test_file_oxygen_output.json - This is the default output from oXygen using the built-in XML to JSON transformation. I would like to match this output.
- source_files\json_test_file_xml-to_json_output.json - This is the output from the xsl-to-json.xsl stylesheet. Notice how it passed domains, class, and other DTD info that the default oXygen one suppressed? All of that should be suppressed (for my purposes).
What's the next step?