【the waiter】announcement:

Xml to json
2258  |   |   |  3

Function introduction

  1. Convert online xml to json
  2. Explanation: Since the child nodes of the xml tree are stored in map during the conversion process, the order of the results obtained after conversion to json is unordered.

Example

Parsing nested json strings

<?xml version="1.0" encoding="UTF-8"?>
<user>
    <id></id>
    <name>name</name>
    <gender>Gender 0-Unknown 1-Male 2-Female</gender>
    <age>age</age>
    <created_date></created_date>
    <updated_date></updated_date>
</user>

after treatment

{
    "id": "",
    "name": "name",
    "gender": "Gender 0-unknown 1-male 2-female",
    "age": "age",
    "created_date": "",
    "updated_date": ""
}