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

always parse elements as objects with __text property #18

Open
aleclofabbro opened this issue Mar 1, 2016 · 0 comments
Open

always parse elements as objects with __text property #18

aleclofabbro opened this issue Mar 1, 2016 · 0 comments

Comments

@aleclofabbro
Copy link

Hi, thanks for the great tool !
i have a question though..
having:
xml1 = '<root><tag>word</tag></root>'
and
xml2 = '<root><tag attr="1">word</tag></root>'
they transform to
{"root":{"tag":"word"}}
and
{"root":{"tag":{"_attr":"1","__text":"word"},}}
is there a way to tranform all tags to objects with __text property indipendently of presence of attributes?
So to keep consistency on json structure ..

Tested with config options, without success:
emptyNodeForm :"object"
skipEmptyTextNodesForObj : false
keepCData : true
enableToStringFunc : false

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