cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

XML to JSON?

naglists
1-Visitor

XML to JSON?

Is anyone using Arbortext to convert XML to JSON?

--
Paul Nagai
10 REPLIES 10

Hi Paul,

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.

// Gareth Oakes
// Chief Architect, GPSL
// www.gpsl.co


> JSON seems like a great way to handle data but not a great way to
> handle documents.

Never say never...
bbender
4-Participant
(To:naglists)

Hi Paul,

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 (
lfraley
12-Amethyst
(To:naglists)

FYI James' aquery video was posted to YouTube a few months back.

Hi Gareth (and everyone else),

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.


Thanks to all for your responses so far!


On Wed, Nov 26, 2014 at 5:21 AM, Gareth Oakes <->

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.

http://www.json.org/java/
Thanks,
-Jeff

Thanks, Jeff!

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.

Hi Paul,

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.

Example Lens article:
lfraley
12-Amethyst
(To:naglists)

Another one that's interesting is this one:


On Wed, Dec 3, 2014 at 2:24 AM, Gareth Oakes <->
Announcements

Top Tags