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

scala.xml.Attribute remove(String, NamespaceBinding, String) method removes all unprefixed attributes unintentionally #5843

Closed
scabug opened this issue May 27, 2012 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented May 27, 2012

steps

  1. call remove(String, NamespaceBinding, String) overload on attributes.
$ scala
Welcome to Scala version 2.10.0-M3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_31).
Type in expressions to have them evaluated.
Type :help for more information.

scala> <test foo="1" bar="2" />.attributes remove (null, scala.xml.TopScope, "foo")
res0: scala.xml.MetaData = 

scala> <test foo="1" bar="2" />.attributes remove "foo" // this works!
res1: scala.xml.MetaData =  bar="2"

problem

{code}remove (null, scala.xml.TopScope, "foo") {code} removes both foo and bar. It in fact removes all unprefixed attributes.

expectation

{code}remove (null, scala.xml.TopScope, "foo") {code} removes only foo and returns {code}bar="2"{code}.

@scabug
Copy link
Author

scabug commented May 27, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5843?orig=1
Reporter: Eugene Yokota (eed3si9n)

@scabug
Copy link
Author

scabug commented May 28, 2012

@lrytz said:
[https://github.com/scala/scala/pull/638]

@scabug scabug closed this as completed Jun 5, 2012
@scabug scabug added this to the 2.10.0 milestone Apr 7, 2017
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

No branches or pull requests

2 participants