Skip to content

xml parsing blindly interprets spliced method call in xmlns attribute as xml.Text("uri") #8253

Closed
@scabug

Description

@scabug
object Test extends App {
  def getNs(v: String) = s"http://schemas.sample.com/sample/$v"
  def getNs2(v: String, dummy: String) = s"http://schemas.sample.com/sample/$v"
  val x0 = <sample><id>1</id></sample>
  val x1 = <sample xmlns:foo="bar"><id xmlns="baz">1</id></sample>

  val x2 = <sample xmlns={getNs("v1")}><id>1</id></sample>
  val x3 = <sample xmlns={getNs2("v1", "dummy")}><id>1</id></sample>
  
  println(List(x0, x1, x2, x3) mkString "\n")
}

x2 is assigned the namspace "v1".

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions