Variable in attribute value of XML-literal
The answer to put it all in curly braces is correct. But don't forget that you need to have a string in the curly braces!
So, you have to write something like (not your example, obviously)
<edge label={name} weight={weight.toString} />
If you come from a language which converts types for you, it can cost you a few minutes of head scratching before you remember what's wrong, because SBT offers no error message, just underlines it.