Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-5843

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

    Details

      Description

      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

      remove (null, scala.xml.TopScope, "foo") 

      removes both foo and bar. It in fact removes all unprefixed attributes.

      expectation

      remove (null, scala.xml.TopScope, "foo") 

      removes only foo and returns

      bar="2"

      .

        Attachments

          Activity

            People

            • Assignee:
              rytz Lukas Rytz
              Reporter:
              eed3si9n Eugene Yokota
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: