-
Notifications
You must be signed in to change notification settings - Fork 5
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
Option removeUnusedNamespaces
does not work as documented
#1
Comments
kristian
pushed a commit
that referenced
this issue
Aug 6, 2020
Adresses issue #1. Fixes a bug which caused unused namespaces to not be removed, if no other namespace was used. Fixes a bug which caused namespaces to be removed, which have been in used by attributes. Adds a comment to the README.md that namespace removal will *not* consider namespaces which are only used for a certain sub-tree of the document.
kristian
added a commit
that referenced
this issue
Aug 6, 2020
Adresses issue #1. Fixes a bug which caused unused namespaces to not be removed, if no other namespace was used. Fixes a bug which caused namespaces to be removed, which have been in used by attributes. Adds a comment to the README.md that namespace removal will *not* consider namespaces which are only used for a certain sub-tree of the document.
Fixed the bugs with 197305a and version 2.0.1. I was well aware of the sub-tre limitation, therefore I mentioned that only namespaces are removed that are not used anywhere in the document. But i think it‘s a good idea to point this out even more clearly int he README.md at least, which I did. Thanks @codeworrior! |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First of all, the implementation contains a typo. It checks for a non-empty array of
used
namespaces before removing the unused ones. I guess the intention was to check forunused
to be non-empty.Fails to remove namespace 'n' from
Second, the implementation only checks for namespaces that are used for elements, not for namespaces that are used for attributes.
Unintentionally removes namespace 'n' from
last but not least, as the regexp based approach does not understand the structure of the XML, it cannot detected when a local namespace is unnecessary in a subtree, it can only decide globally.
Does not remove 2nd declaration of namespace 'n' in
This does not cause errors, but does not achieve the optimal reduction.
The 2nd issue is the most important one for our use case in UI5 as we have some special namespaces that are used only for attributes (e.g. for custom data).
The text was updated successfully, but these errors were encountered: