Skip to main content
1-Visitor
November 26, 2014
Question

XML to JSON?

  • November 26, 2014
  • 10 replies
  • 3220 views
Is anyone using Arbortext to convert XML to JSON?

--
Paul Nagai

    10 replies

    16-Pearl
    November 26, 2014
    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
    1-Visitor
    November 26, 2014

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

    Never say never...
    4-Participant
    November 26, 2014
    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 (
    1-Visitor
    November 26, 2014
    FYI James' aquery video was posted to YouTube a few months back.
    naglists1-VisitorAuthor
    1-Visitor
    December 1, 2014
    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 <->
    1-Visitor
    December 2, 2014
    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
    naglists1-VisitorAuthor
    1-Visitor
    December 2, 2014
    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.
    16-Pearl
    December 3, 2014
    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:
    1-Visitor
    December 3, 2014
    Another one that's interesting is this one:


    On Wed, Dec 3, 2014 at 2:24 AM, Gareth Oakes <->
    1-Visitor
    December 3, 2014
    The url now:


    >> Subject: [adepters] - RE: XML to JSON?
    >> Resent-From: "-" <->
    >> Resent-Date: Monday, 1 December 2014 22:33
    >>
    >>
    >> 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 <->
    >> wrote:
    >>
    >>> 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
    >>>
    >>> From: Paul Nagai <->
    >>> Reply-To: Paul Nagai <->
    >>> Date: Tuesday, 25 November 2014 18:18
    >>> To: "-" <->
    >>> Subject: [adepters] - XML to JSON?
    >>> Resent-From: "-" <->
    >>> Resent-Date: Tuesday, 25 November 2014 18:18
    >>>
    >>>
    >>> Is anyone using Arbortext to convert XML to JSON?
    >>>
    >>> --
    >>> Paul Nagai
    >>>
    >>