Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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,
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!