-
Notifications
You must be signed in to change notification settings - Fork 33
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
Handling Self Closing Tags #37
Comments
Fixed Original: if root.text and self.text_content is not None: Revised: if root.text and self.text_content is not None: |
@dvilajeti01 -- which convention would you like this for? The reason is that the conventions we use already have a standard for self-closing tags. For example:
Which convention would you like to change to an empty string, please? I'd also need to refer to the original standards for these to see if this is allowed or not. |
Sorry, I realized you meant the Yahoo convention. The convention does say that "Simple XML elements (elements that contain only content) become string/value pairs." By this logic, I'll add a fix for this and push it. |
@sanand0 Hey so I just ran the new code and once I tried to run it I ran into an error:
|
@dvilajeti01 I'm unable to reproduce this in any version of Python. Could you please try installing a dev version: git clone https://github.com/sanand0/xmljson
cd xmljson
pip uninstall xmljson
pip install -e . ... and see if this problem persists? |
Ok just installed the dev version and the conversion worked successfully |
There seems to be another bug so given 0 |
This is the change I propose to make I don't know if you got a chance to look at it
|
Good catch @dvilajeti01 -- thanks. The fix you proposed doesn't handle the |
Ok, so I checked it and it works but a new problem arises. The order of the attributes for some reason seem to change orders. Here are the examples of the differences. So the first bit is the original Yahoo Convention pre any fixes and the latter is the Yahoo Convention post fix. Pre:
Post:
|
How can I treat self closing tags or empty elements as "element": "" instead of "element": {}?
The text was updated successfully, but these errors were encountered: