I'm interested in your use case here. In my mind there are essentially two types of XML – documents or data. JSON seems like a great way to handle data but not a great way to handle documents. Arbortext is a great way to handle documents, but not so much for data.
We rarely do conversions to JSON but if I was going to do that I'd be inclined to use XSLT.
I haven't had the scenario to convert XML to JSON in Arbortext, but for web development I've converted XML web services to JSON using a Javascript library called X2JS (
The use-case ... well ... a team that we support delivers XML to a post-production conversion process that delivers as its final product a web ... thing (part site, part application). The powers that be want to refactor all of the technology and process used to support that web thing with much more scalability / much fewer human touches or hand-offs. One of the possibilities being considered uses JSON to deliver parts of that web thing. As such, we are being asked whether the content we currently support can be delivered to that potential To Be environment and further if it would scale and support content creation for other parts of the web thing.
I'm currently skeptical that it would make sense to develop an XML to JSON conversion for the purposes of documentation. I'm downright hostile to the idea that if it were sensible that it would make sense to do it IN Arbortext (although it could and likely would certainly make sense to develop an authoring environment that were specifically developed to support both the eventual publication format as well as the conversion). That said, as long as it isn't completely backward cost prohibitive fragile etc., I would like to extend our reach flexibility services scope etc.
So I was checking to see if anyone had already done this or something similar. Thus far, you haven't changed my mind about the XML to JSON, though.
On Tue, Dec 2, 2014 at 5:36 AM, Jeff Stevenson <-> wrote:
> Hi Paul, I've used Java to convert XML to JSON using the Java packages > from json.org. I've had pretty good success with them. I've used it on > more abstract XML. I'm not sure what it would do with a document-based XML > like DITA or Docbook, but it would be worth a try. You can find the JavaDoc > here with a link to the files.
Interesting, thanks for sharing. While I agree with your viewpoint on XML vs JSON for documents, a good point of reference to check on is eLife Lens. It is a web application that presents scientific research in a more interactive way (rather than just flat PDF). It is based on XML (JATS?) documents converted to JSON, so might be a good point of reference for what you guys are considering.