Open 1mike12 opened 2 years ago
where attributes are directly added as keys to the element object instead of being placed into a separate _attributes object
_attributes
this makes it much easier to work with xml that don't have text inbetween the tags and instead keeps all its info in single <element />.
<element />
It's really annoying to work with the _attributes object constantly if your XML shape is anything like the following:
<parent attr1="one" attr2="two"> <child k1="1" k2="2" ... kn="n" /> <child k1="1" k2="2" ... kn="n" /> ... </parent>
before
{ parent: { __attributes: {attr1: "one", attr2: "two"}, child: [{__attributes: {k1: "1", k2:"2", kn: "n"} }] } }
after
{ parent: { attr1: "one", attr2: "two" child: [{k1: "1", k2:"2", kn: "n"}] } }
where attributes are directly added as keys to the element object instead of being placed into a separate
_attributes
objectthis makes it much easier to work with xml that don't have text inbetween the tags and instead keeps all its info in single
<element />
.It's really annoying to work with the _attributes object constantly if your XML shape is anything like the following:
before
after