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

XML::Builder behaves strangely with respect to namespaces #1712

Closed
flavorjones opened this issue Jan 28, 2018 · 4 comments · Fixed by #2246
Closed

XML::Builder behaves strangely with respect to namespaces #1712

flavorjones opened this issue Jan 28, 2018 · 4 comments · Fixed by #2246

Comments

@flavorjones
Copy link
Member

Originally pointed out on nokogiri-talk by Corey Powell (who I think is @IceDragon200 on GitHub):

This gist contains a sample script, the expected and actual output from nokogiri

https://gist.github.com/IceDragon200/873139e6c7d395dfcd9793949f9b2246

Summary: For some reason, namespaces are being passed down to child elements, is there anyway to disable this behaviour? (without some voodoo XML fragment magic)

@flavorjones
Copy link
Member Author

I've pushed a branch with some comments and a small test to 1712-flavorjones-namespace-reparenting-behavior. If anyone works on this, please pick up that branch and read the comments in the last commit.

@flavorjones
Copy link
Member Author

Good news, commit 1f483f0 on main fixes this issue. Will be fixed in the v1.12 release.

@flavorjones flavorjones added this to the v1.12.0 milestone May 20, 2021
flavorjones added a commit that referenced this issue May 20, 2021
introduced by 1f483f0 which accidentally fixed #1712.

Closes #1712
flavorjones added a commit that referenced this issue May 20, 2021
…e-reparenting-behavior

namespace behavior change when reparenting

---

**What problem is this PR intended to solve?**

Add tests for the behavior change introduced by 1f483f0.

That behavior change fixes #1712


**Have you included adequate test coverage?**

Yarp.


**Does this change affect the behavior of either the C or the Java implementations?**

The Java implementation already exhibited this behavior; and 1f483f0 brought the two implementations in line with each other.
@flavorjones
Copy link
Member Author

Whoo, this got complicated and this behavior is going to be reverted in v1.12.4 but Documents will have an attribute you can set to change this behavior to what's described above; and Builder will allow you to set that attribute via the initializer. Keep your eyes open for that version and check out the update Builder docs.

@flavorjones
Copy link
Member Author

See #2320 for the changes I'd like to make. Comments and feedback welcome.

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

Successfully merging a pull request may close this issue.

1 participant