question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

converting xml to json: self-closing tag

See original GitHub issue

Hi, I’m working with this nice lib to convert xml/json data and run into some problem with the “-self-closing” : “true” result, if the source xml node is like <nodename />.

to be honest: I didnt studied the code now and I’m not a java expert. But it seems, that there is no way to deactive the value “self-closing” with e.g. an argument?! Is such a feature planned?

May I ask you, why you add these self-closing feature? IMO I dont understand why to set an object with this value. I run into trouble with my frontend webapp with the resulting json I get with this lib. Dont you agree that something like { "nodename" : null } is more the result to expect? Also I dont think that the current integration is 100% json correct. your self-closing : “true” is set as string instead of boolean. Would be great to hear about what you think, if there are any easy workarounds or sth similar. Thx in advance! BR

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DubZyycommented, Nov 20, 2019

Thx a lot. Checked new mode function. Works like a charm. Bye thumbs up

Read more comments on GitHub >

github_iconTop Results From Across the Web

Avoid to generate XML self-closing tags for empty elements ...
If you want to avoid XML self-closing tags, you can use @JsonProperty(value = "TEST") @JsonSerializer(nullsUsing = NullSerializer.class) ...
Read more >
Convert XML to JSON Using Jackson - Baeldung
In this tutorial, we'll see how to convert an XML message to JSON using Jackson. For readers new to Jackson, consider getting familiar...
Read more >
XML To JSON Questions - Oxygen XML Forum
The latest editor converts JSON to this instead: Code: Select all ... and an empty self-closing XML element, such as: Code: Select all...
Read more >
How to Convert JSON to XML or XML to JSON in C# - Code ...
Demonstrate how to convert JSON to XML back and forth using System.Text.Json and Newtonsoft.Json with detail explanation and examples.
Read more >
Solved: Converting XML to JSON failing with gs.xmlToJSON w...
To that end I created a script include that converts Xml to Json and that converts Json To XML. The Json to XML...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found