-
-
Notifications
You must be signed in to change notification settings - Fork 309
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
Implement a way of parsing xml to closely resemble that of xml. #160
Implement a way of parsing xml to closely resemble that of xml. #160
Conversation
Each xml node will be parsed to { nodeName, attr, val, namespace, children}
Thanks for the PR. Can you plz add necessary tests? So I can understand your thoughts better. |
Thanks for adding the tests to cover few scenarios. We received a feature request for some part of this implementation few days back, and we ended with the discussion that a separate schema builder should be written. So, here, we want to understand the need and need to discuss the output structure before merging the changes. Where did you get this idea from? your personal project/need or you found the same solution somewhere else in other parsers etc. |
Glad someone else also has such a request. In our development, we felt that it's very cumbersome to have to deal with aggregation: Our code has to do lots of check to see if the object for a given nodeName is an array or not, it created so much if else conditions and it's becomes hard to manage. |
Thanks for the suggestion, will check it out. Sorry for the late reply. |
As we have published arrayMode now. I'm closing this PR. Thanks for your effort. |
Purpose / Goal
Be able to parse each xml node in the form of { nodeName, attr, val, namespace, children}.
This makes it easier to process JSON from xml because there is not need to constantly check if a child node is an array or non-array.
This feature only applies when you enable resembleXml option (default is false).