stchris / untangle

Converts XML to Python objects
MIT License
611 stars 83 forks source link

TypeError: 'Element' object does not support item assignment #65

Open thehayat opened 4 years ago

thehayat commented 4 years ago

Able to read xml but wanted to change the attribute value and append it as a new object. But it gives assignment error.

sample_data

<TBASettings>
 <Tenant urlTag="nmdcdemo" id="9001" tbaStatus="true" nonValidatedExtensions=".jpg"/>
</TBASettings>

wanted to change and append new object as

<TBASettings>
 <Tenant urlTag="nmdcdemo" id="9001" tbaStatus="true" nonValidatedExtensions=".jpg"/>
<Tenant urlTag="nmdcdemo2" id="9002" tbaStatus="true" nonValidatedExtensions=".jpg"/>
</TBASettings>
stchris commented 4 years ago

Hi @thehayat ! I'm not quite sure I understand which error you are seeing. Maybe you can post some code snippet or even better: a failing test.