-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XML attributes not handled/parsed #16
Comments
@CoffeeJack - I think this is a very valid concern. Let's see - perfect scenario, how would you like that represented in a converted data structure? So, text like the following:
is parsed into
Assuming the addition of an attribute on one of the root children, how would you envision that represented in the parsed object? |
@kyleobrien91 I came across this issue and had to subclass <?xml version="1.0" encoding="utf-8"?>
<root>
<field name="attribute_a">121.0</field_a>
<field id="0001" name="attribute_b">dasd</field_b>
</root> Is parsed into: [
{'field': 121, 'name': 'attribute_a'},
{'field': 'dasd', 'id': 0001, 'name': 'attribute_b'},
] Unfortunately it doesn't work if there was an attribute to parse on the root element, as that attribute would be tacked onto the end of the list. But for my purposes that was fine. |
Based on this issue: jpadilla#16 Changes to handle/parse XML attributes.
Hi all, I have fixed this issue doing some changes on You can find it on next pull request: #39 Best, |
The idea was to parse something like the following: <?xml version="1.0" encoding="utf-8"?>
<root>
<field name="attribute_a">121.0</field_a>
<field id="0001" name="attribute_b">dasd</field_b>
</root> Is parsed into:
|
If I have something like:
<?xml version="1.0" encoding="utf-8"?> <foo status="wolololol"> Bar </foo>
The status="wololol" is not captured. Any suggestions as to how I can capture it?
The text was updated successfully, but these errors were encountered: