You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Define an XML literal that redefines a namespace binding (xmlns attribute) within a child element.
Welcome to Scala version 2.10.0 (JavaHotSpot(TM) 64-BitServerVM, Java1.6.0_33).
Type in expressions to have them evaluated.
Type:help for more information.
scala>valfoo= <x:fooxmlns:x="http://foo.com/"><x:barxmlns:x="http://bar.com/"><x:baz/></x:bar></x:foo>
foo: scala.xml.Elem= <x:fooxmlns:x="http://foo.com/"><x:barxmlns:x="http://bar.com/"><x:baz/></x:bar></x:foo>
scala> foo.child.head.scope.toString
res0:String=" xmlns:x="http://bar.com/" xmlns:x="http://foo.com/""
scala> assert(foo.child.head.scope.toString ==""" xmlns:x="http://bar.com/"""")
java.lang.AssertionError: assertion failed
h3.problem
The child element duplicates namespace binding. In the above example, xmlns:x is duplicated.
h3.expectation
The outer namespace binding with the same prefix should be overridden by the inner namespace binding.
This is caused Scala compiler stacking outer namespace binding when defining inner Elem. See ast.parser.SymbolicXMLBuilder.
The same bug is duplicated in Scala library when XML document is created using scala.xml.XML.loadString(...) again due to outer namespace binding stacked in scala.xml.parsing.FactoryAdapter.
The text was updated successfully, but these errors were encountered:
h3.steps
h3.problem
xmlns:x
is duplicated.h3.expectation
h3.notes
This is caused Scala compiler stacking outer namespace binding when defining inner
Elem
. Seeast.parser.SymbolicXMLBuilder
.The same bug is duplicated in Scala library when XML document is created using
scala.xml.XML.loadString(...)
again due to outer namespace binding stacked inscala.xml.parsing.FactoryAdapter
.The text was updated successfully, but these errors were encountered: