Skip to content
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

Parsing of XML nodes without children types #19

Open
wisotzky opened this issue May 26, 2018 · 0 comments
Open

Parsing of XML nodes without children types #19

wisotzky opened this issue May 26, 2018 · 0 comments

Comments

@wisotzky
Copy link

I would like to have the ability in jxmlease to control how XML nodes w/o children are rendered. At the moment, this is done as empty string:

>>> x2 = jxmlease.parse("<a/>")
>>> x2
XMLDictNode(xml_attrs=OrderedDict(), value=OrderedDict([(u'a', XMLCDATANode(xml_attrs=OrderedDict(), value=u''))]))
>>> x2.prettyprint()
{u'a': u''}

So actually it means, that even has no children nodes, it is associated with an empty string. From an implementation point of view, I would like have the possibility to control how this is rendered. Technically it could be an empty list, empty dict or NoneType as well. Preferred implementation from my point of view would actually be the NoneType:

>>> x2 = jxmlease.parse("<a/>")
>>> x2.prettyprint()
{u'a': None}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant