Comments (11)
@dejavuhuh I added new mode REPLACE_EMPTY_STRING_WITH_EMPTY_VALUE
to the U.jsonToXml(json)
method.
from underscore-java.
Hello @dejavuhuh,
Thank you for improvement suggestion.
from underscore-java.
Hello @dejavuhuh,
Thank you for improvement suggestion.
Hello @javadev,
Thank you for replying to me, and I suddenly remembered some situations like:
// replace <aaa></aaa> to "aaa": null
U.xmlToJson(xml, U.Mode.REPLACE_EMPTY_TAG_WITH_NULL);
// and so on...
Last of the last, there will be 8 situations:
// replace <aaa></aaa> to "aaa": null
// replace <aaa></aaa> to "aaa": ""
// replace <aaa /> to "aaa": null
// replace <aaa /> to "aaa": ""
and reversely
// replace "aaa": null to <aaa></aaa>
// replace "aaa": "" to <aaa></aaa>
// replace "aaa": null to <aaa />
// replace "aaa": "" to <aaa />
from underscore-java.
I added two new modes for the U.xmlToJson(xml)
: REPLACE_EMPTY_TAG_WITH_NULL and REPLACE_EMPTY_TAG_WITH_EMPTY_STRING
.
For U.jsonToXml(json)
we have a mode: REPLACE_NULL_WITH_EMPTY_VALUE
from underscore-java.
I added two new modes for the
U.xmlToJson(xml)
:REPLACE_EMPTY_TAG_WITH_NULL and REPLACE_EMPTY_TAG_WITH_EMPTY_STRING
.For
U.jsonToXml(json)
we have a mode:REPLACE_NULL_WITH_EMPTY_VALUE
Thanks, but I would like a mode for replacing { "aaa": "" }
to <aaa></aaa>
instead of <aaa string="true"/>
like
String xml = U.jsonToXml("{ \"aaa\": \"\" }", U.Mode.REPLACE_EMPTY_STRING_WITH_EMPTY_TAG);
System.out.println(xml); // <aaa></aaa>
from underscore-java.
@dejavuhuh I added new mode
REPLACE_EMPTY_STRING_WITH_EMPTY_VALUE
to theU.jsonToXml(json)
method.
Thanks very much!
from underscore-java.
The new version was released today. 🎉
from underscore-java.
Hello @dejavuhuh,
Thank you for improvement suggestion.
@javadev Hey, I am glad to see that you just released a new version a week ago, but it seems that multiple U.Mode still not supported?
from underscore-java.
Hello @dejavuhuh,
I added two new modes for xmlToJson method.
What other modes do you need?
from underscore-java.
Hello @dejavuhuh,
I added two new modes for xmlToJson method.
What other modes do you need?
Like this, which can replace self closing with null and also replace empty value with null
String json = U.xmlToJson(xml, U.Mode.REPLACE_SELF_CLOSING_WITH_NULL, U.Mode.REPLACE_EMPTY_VALUE_WITH_NULL);
I can pass two or more U.Mode into the xmlToJson (or jsonToXml) method
from underscore-java.
Hi @dejavuhuh,
The new mode REPLACE_EMPTY_TAG_WITH_NULL
replaces emply tag and self closing tag with null.
from underscore-java.
Related Issues (20)
- How to replace null value with empty when use U.jsonToXml() HOT 3
- How to convert xml HOT 1
- How to replace root element in generated XML with custom root name? HOT 3
- How to create the xml with attributes using underscore-java lib? HOT 3
- What is the purpose of FromType paramater in U.fromXmlToMap() method? HOT 1
- xmlToJson: array with size = 1 is written as object HOT 1
- How to get the deeply nested xml elements while converting from xml to map? HOT 4
- Remove string="true" attribute while converting json to xml HOT 3
- Convert xml to json HOT 9
- Build json with null value HOT 4
- How to create node with value and attribute? HOT 1
- Retaining the mandatory <root> during jsontoxml conversion HOT 7
- Is there a get for nested hetrogenus maps? HOT 3
- xml nil="true" support HOT 5
- How to make json string to beautiful json format with color HOT 7
- Is the source for xmltojson.jar available? HOT 3
- Site pointing to 1.77 HOT 2
- JSON serialization should quote enum members HOT 1
- Add Base32 RFC 4648 alphabet HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from underscore-java.