java - 避免使用 net.sf.json-lib 使用电子符号
问题描述
我正在使用 com.hynnet.json-lib 将 XML 转换为 JSON。这里的 PB 是对于长整数,这个库使用指数而不是整数。
我可以避免使用这个库还是应该使用另一个库?
我的 XML:
<?xml version="1.0" encoding="ISO-8859-15"?>
<rootTag>
<_id type="number">7000000001</_id>
</rootTag>
我的转换代码:
XMLSerializer xmlSerializer = new XMLSerializer();
xmlSerializer.clearNamespaces();
xmlSerializer.setSkipNamespaces(true);
xmlSerializer.setForceTopLevelObject(false);
net.sf.json.JSON json = xmlSerializer.read(xmlString);
结果json:
{“_id”:7.000000001E9}
预期的json:
{“_id”:7000000001}
解决方案
推荐阅读
- neo4j - Neo4j Cypher - 如何限制 50% 的 MATCH 结果
- reactjs - React Azure AD 返回空白页
- php - 使用 AJAX 和 PHP,创建的表单提交错误的错误值
- node.js - 如何从仅在最后几分钟内插入的 MongoDB 中获取文档?
- typescript - 故事书构建错误您可能需要刷新浏览器
- excel - 如何在 VBA 中同时选择特定范围和数据透视表?
- arrays - 输出绑定到数组的符号 (C++)
- facebook-graph-api - Facebook API 突然清空潜在客户结果
- terraform - 是否可以使用 terragrunt 调用多个 terraform 模块
- python - Coinbase pro API 在购买订单上返回 None