I am new to Python and Json. I am trying to convert xml content into json using python.
i have an xml file with as below:
<pins>
<pin name="PA3">
<pinNumber package="QFN64" value="1"/>
<pinAlias alias="PA3" module="GPIO"/>
.....
I am able to generate json file using xmltodict in python created as shown below:
{
"device": {
"pins": {
"pin": [
{
"pinAlias": [
{
"alias": "PA3",
"module": "GPIO"
}, ......
But i need to generate the json file as:
{
"device": {
"pins": [
{
"pinAlias": [
{
"alias": "PA3",
"module": "GPIO"
},....
Can anyone help me in achieving this?