Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.3k views
in Technique[技术] by (71.8m points)

java解析 xml字符串

下面这段xml是用第三方服务中获取到的字符串,现在需要获取到根节点的属性值
尝试过很多解析方式,<GATHER_INFO>节点可以解析出来,但是其他节点都被解析成了空,或者换行符之类的,求解

<GATHER_INFO AREA_ID="3501730000" CHNL_NO="3501730001" I_E_TYPE="I" SEQ_NO="20201223171219000075"><IC><DR_IC_NO>31231</DR_IC_NO><IC_DR_CUSTOMS_NO></IC_DR_CUSTOMS_NO><IC_CO_CUSTOMS_NO></IC_CO_CUSTOMS_NO><IC_BILL_NO>3123</IC_BILL_NO><IC_GROSS_WT>1233</IC_GROSS_WT><IC_VE_CUSTOMS_NO></IC_VE_CUSTOMS_NO><IC_VE_NAME>1231231</IC_VE_NAME><IC_CONTA_ID></IC_CONTA_ID><IC_ESEAL_ID></IC_ESEAL_ID><IC_BUSS_TYPE></IC_BUSS_TYPE><IC_EX_DATA></IC_EX_DATA></IC><WEIGHT><GROSS_WT>6666</GROSS_WT></WEIGHT><CAR><VE_NAME>冀BM4471蓝</VE_NAME><CAR_EC_NO>2112</CAR_EC_NO><VE_TYPE></VE_TYPE><VE_WT>0</VE_WT><VE_CUSTOMS_NO></VE_CUSTOMS_NO></CAR><TRAILER><TR_WT>0</TR_WT><TR_NAME></TR_NAME><TR_EC_NO>法法131</TR_EC_NO></TRAILER><CONTA><CONTA_NUM>2</CONTA_NUM><CONTA_RECO>1</CONTA_RECO><CONTA_ID_F>321312</CONTA_ID_F><CONTA_ID_B>fff13123</CONTA_ID_B><CONTA_MODEL_F>20</CONTA_MODEL_F><CONTA_MODEL_B>20</CONTA_MODEL_B></CONTA><SEAL><ESEAL_ID></ESEAL_ID><SEAL_KEY></SEAL_KEY></SEAL></GATHER_INFO>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...