-
Notifications
You must be signed in to change notification settings - Fork 148
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
Support for custom attributes #27
Comments
I was looking for this also, it seems all dict keys are treated like child nodes, maybe we can get keys starting with '@' (since they're invalid XML node names) to be treated as custom attributes, so we end up with something like: {
'checkout': {
'@currency': 'BRL',
'@text': 10.5
}
} <?xml version="1.0" encoding="UTF-8" ?>
<root>
<checkout type="dict" currency="BRL">
10.5
</checkout>
</root> We might lose attribute types and will only be possible on dicts. |
This would be awesome to have. I need to be able to add 'name' attributes to generate Android externalized string resource files. Great approach @mstrcnvs, would love to see it implemented. |
+1 |
Was this ever implemented or at the very least in a fork? |
Also need it. |
@BowenFu I ended up using the |
@neetjn Thanks. That is very helpful. |
Hi guys, Crazy to think that this issue has gone back all the way to 2014. I have started developing a solution you can see over on #66. Let me know what you guys think. Feedback is much appreciated. |
<?xml version="1.0" encoding="UTF-8"?>
<root>
<checkout type="dict" currency="BRL">
10.5
</checkout>
</root> may be converted to json {
"checkout": {
"-type": "dict",
"-currency": "BRL",
"#text": "\n 10.5\n "
}
} |
You can do that with xmltodict. It supports it both ways. |
Maybe this can already be done, but I haven't seen it. Can insert custom attributes other than "type" and "id"?
The reason I bring this up is that this could very easily support converting a json file into a kml file save for that limitation.
The text was updated successfully, but these errors were encountered: