Fix keep xs ns prefixes - #335
Open
theseal wants to merge 4 commits into
Open
Conversation
Fixes #333 The lxml.etree.cleanup_namespaces function only considers namespaces used in XML Element and Attribute names, but not in attribute values. The xs namespaces is used only in values of xsi:type attributes and is thus not considered as used by LXML - and would get removed. Keep it explicitly to avoid creating invalid metadata. Co-authored-by: Johan Wassberg <jocar@sunet.se>
The namespace cleanup was being ignored for MDQ per-entity publication - it did nothing when invoked on element other than the root element. It would also be resource intensive to clean up when publishing each individual element. Clean up instead at the source - and there, the guard condition is no longer required (the working document is always XML) Co-authored-by: Johan Wassberg <jocar@sunet.se>
btmattsson
reviewed
Sep 4, 2026
Instead of a hardcorded list of known Qname defines
Contributor
Author
|
@vladimir-mencl-eresearch Can you try this branch out before we do a merge? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@vladimir-mencl-eresearch commits where unsigned and I was not allowed to write in the incoming branch so had to do this branch dance. 🤷♂️
Also added test to check for the "default" NSes.
Closes #333 and #334