-
Notifications
You must be signed in to change notification settings - Fork 4
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
bug: defaultNamespace detection fails on XML-attributes when deserializing #11
Labels
bug
Something isn't working
Comments
working patch: serializable/serializable/__init__.py Lines 455 to 462 in 9bc4abc
if default_namespace is None:
_namespaces = dict([node for _, node in
SafeElementTree.iterparse(StringIO(SafeElementTree.tostring(data, 'unicode')),
events=['start-ns'])])
- if 'ns0' in _namespaces:
- default_namespace = _namespaces['ns0']
- else:
- default_namespace = ''
+ default_namespace = (re.compile(r'^\{(.+?)\}.').search(data.tag) or (None,_namespaces.get('')))[1]
|
2 tasks
jkowalleck
added a commit
that referenced
this issue
Sep 28, 2023
fixes #11 Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
jkowalleck
changed the title
bug: defaultNamesspace detection fails on XML-attributes when deserializing
bug: defaultNamespace detection fails on XML-attributes when deserializing
Oct 1, 2023
jkowalleck
added a commit
that referenced
this issue
Oct 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
and this one was completely unable to detect the defaultNS, and assumed it was '' -- which is the identifier for the defaultNS not the defaultNS itself ...
and then the NameSpace-detection on XML-attributes fails ...
see CycloneDX/cyclonedx-python-lib#438 (comment)
The text was updated successfully, but these errors were encountered: