Skip to content
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

fix: Improper namespace application in elementToBytes #580

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeremy-clerk
Copy link

@jeremy-clerk jeremy-clerk commented Nov 14, 2024

In the elemToBytes function when applying namespaces to the doc.Root() it is assumed that the namespace will have a prefix. If the namespace is the default namespace xmlns the function improperly applies the namespace as:

xmlns:=<URI> - which is invalid XML.

This can cause errors when parsing Assertions that do not have explicit namespaces applied and inherit the default namespace from their parent element.

This PR updates the elemToBytes function to account for this.

Related issues:
#578
#527

@ay4toh5i
Copy link

@crewjam Hi, I wanted to mention that I’ve also been struggling with this issue, especially in cases where the default namespace is not applied correctly, leading to parsing errors. This fix seems very valuable, and I’d appreciate it if you could take a moment to review it.
Looking forward to your response. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants