Я новичок в заводной.У меня проблема с моим требованием.
Мое требование - преобразовать вложенный XML в Json
Ниже приведен файл ввода:
<root>
<Account>
<name>name</name>
<age>age</age>
</Account>
<Assets>
<record>
<info>info</info>
<details>details</details>
<attributes>
<property>property</property>
</attributes>
</record>
<record>
<info>info 1</info>
<details>details 1</details>
<attributes>
<property>property 1</property>
</attributes>
</record>
</Assets>
</root>
Предпочтительным будет выводкак показано ниже:
{
"root":[
{"account":
"records":{
{"name":"name","age":"age"}
}
},
{"assets":
"records":{
"info":"info","details":"details"
},
{"attributes":{"property":"property"}}
,
{
"info":"info 1","details 1":"details 1"
},
{"attributes":{"property":"property 1"}}
}
]
}
В сегменте Assets
мы получим n
количество записей, все данные записей должны быть заполнены внутри "record":{}
.
Есть ли способ добиться этого?
Любые ваши отзывы будут высоко оценены