Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Problem with XMLSerializer

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a big problem with XMLSerializer... I use JSON lib (net.sf.json) and this is my code:

My current output is:

But I would like have this msg:

Unfortunately now I missing tag nameValues. Could you help me with this?
 
Ranch Hand
Posts: 579
6
jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you elaborate your problem a bit more.

I tried to run your sample code, here is what I found to be working:



Now this does look like working.



The other question you asked regarding newDocuments.

From what I see online regarding json format, {} represent object attributes and [] represent array attribute.

Your xml node: looks more like an array than an object.

You will have to check your xml structure again to reach your final json format.
 
Power corrupts. Absolute power xxxxxxxxxxxxxxxx is kinda neat.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!