Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

json.org; XML to JSON; XML sequence with 1 element to JSON Array.

 
a bbb
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am using the Java implementation of http://www.json.org/ with sources here:
https://github.com/stleary/JSON-java

I have a problem converting a sequence of elements.
Sometimes my sequence has 1 element and other times it has several.

Is transformed to


While


Is transformed to


My method is


How can I instruct the XML.toJSONObject(xmlText)
that XML element <contractLine> Must be an Array?

I searched the web,
read the documentation
but I did not find a suitable approach for this library.

Thank you,
 
mooooooo ..... tiny ad ....
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!