jfu
jfu

Reputation: 1700

Scala: reference an xml literal from another xml

Is it possible to reference one xml variable from another xml? E.g. is it possible to do something like this:

val foo = <foo> foo text </foo>

val bar = <bar> + foo + </bar>

so that bar will contain foo as it's child:

<bar><foo>foo text</foo></bar>

Upvotes: 1

Views: 40

Answers (2)

user908853
user908853

Reputation:

Try <bar>{foo}</bar>

Upvotes: 3

mesutozer
mesutozer

Reputation: 2859

You can use the following:

val bar = <bar>{foo}</bar>

Upvotes: 3

Related Questions