• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 595
6
jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
It's fun to be me, and still legal in 9 states! Wanna see my tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic