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
chore(xmlupload): improve parse xml function #819
chore(xmlupload): improve parse xml function #819
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we have 2 functions that almost do the same:
parse_and_remove_comments_xml_file()
parse_and_clean_xml_file()
This is confusing, because it is almost duplicating things, but with slight deviations. This makes it very hard to understand the paths that the program can take.
These code paths should be disentangled.
I agree, the reason why I did not do this here is because it opens a typing can of worms. If you would like to combine the functions, I am happy to do that, but I suggest another PR for that. |
Why would you like to do it in another PR? AFAIU, you introduced the duplication in the present PR. It doesn't seem natural to me to introduce a duplication/bad architecture in one PR, and then schedule a follow-up PR...? |
Because I wanted to focus on PR that introduces the new feature and this stood in the way. But if it is a deal-breaker, then I can do it here. |
Currently for the validate xml, the comments were not removed. This caused problems when finding the
encodings
attributes. However, we need the namespaces for the first validation step. Therefore a function was created that only parses the file and removes the comments.