nashwaan / xml-js

Converter utility between XML text and Javascript object / JSON text.
MIT License
1.29k stars 181 forks source link

_attributes gets added to _attributes? #191

Open blaasvaer opened 2 years ago

blaasvaer commented 2 years ago

This:

<timetablebook creation="2021-09-20T10:50:45" creation_user="abc" desc="" district_name="" filters="filters" name="" order_type="58" timetablename="K12122020" timetablestatus="-1" timetableversionid="2055" tps_version="4.16.405.11" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="K22.xsd">

Becomes this:

"timetablebook": {
    "_attributes": {
        "creation": "2021-09-20T10:50:45",
        "creation_user": "abc",
        "desc": "",
        "district_name": "",
        "filters": "filters",
        "name": "",
        "order_type": "58",
        "timetablename": "K12122020",
        "timetablestatus": "-1",
        "timetableversionid": "2055",
        "tps_version": "4.16.405.11",
        "_attributes": {
            "creation": "2021-09-20T10:50:45",
            "creation_user": "abc",
            "district_name": "",
            "filters": filters",
            "name": "",
            "order_type": "58",
            "timetablename": "K12122020",
            "timetablestatus": "-1",
            "timetableversionid": "2055",
            "tps_version": "4.16.405.11"
        }
    },

Notice how the _attributes get added to _attributes itself.

This has to be a bug.