Issue with JSON output

  • Anonymous - 2013-04-19

    I've just installed the library and am having an issue with the output.
    Given this simple XML string:


    and this PL/SQL (direct from the example):

    set serveroutput on;
      arr json_list;
      arr := json_ml.xmlstr2json('<permit_list><permit><a>123</a><b>123</b></permit><permit><a>asdf</a><b>asdfgasdgadsfh</b></permit></permit_list>');

    I get the following JSON:

    ["permit_list", ["permit", ["a", "123"], ["b", "123"]], ["permit", ["a", "asdf"], ["b", "asdfgasdgadsfh"]]]

    Which doesnt represent the original XML structure, it  is instead giving me arrays of data rather than the elements.

    Any ideas?

  • James Sumners

    James Sumners - 2013-04-19

    From :

    JsonML (JSON Markup Language) is an application of the JSON (JavaScript Object Notation) format. The purpose of JsonML is to provide a compact format for transporting XML-based markup as JSON which allows it to be losslessly converted back to its original form.

    From the jsonml package:

    This transformation converts any XML document into JsonML.

    So… you got exactly what you asked for. JSONML != JSON.

  • Anonymous - 2013-05-02

    Thanks, but is there a way to convert an XML obj to a proper JSON obj? Or only the JSONML representative form?


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks