wood burning stoves*
The moose likes Other Open Source Projects and the fly likes json attribute occuring as an array and an object at different places Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "json attribute occuring as an array and an object at different places" Watch "json attribute occuring as an array and an object at different places" New topic
Author

json attribute occuring as an array and an object at different places

s ravi chandran
Ranch Hand

Joined: Dec 20, 2010
Posts: 151
hi guys,
I have a requirement, I am getting an xml from an object, which I have to convert to json object. The conversion is happening alright, but there is a small issue.. the resultant json is not being accepted by the service, as a node (lets call it A) is coming as an object and as an array at different levels. I suspect that this A in xml mostly occurs in two forms, the normal node form and self - closing tag form. here the self closing tags are being treated as an array somehow, which is not being accepted by the service. I searched on net and found the string replace function to fix it. I created a sample xml to test replacing all self closing tags with normal ones. here is the xml:



Here is the code which I am using to replace the xml node :



but it doesnt seem to be working.. am I going in right direction?

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: json attribute occuring as an array and an object at different places
 
Similar Threads
How to fill up JSONArray data inside the select tag of JSP Page
connect tandroid to mysql using php to insert new records
Frames in struts
some notes on xml
Strange submit on a JSP page