Skip to content

Instantly share code, notes, and snippets.

@yutaono
Created April 2, 2015 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yutaono/b33bc706657c7b03a09b to your computer and use it in GitHub Desktop.
Save yutaono/b33bc706657c7b03a09b to your computer and use it in GitHub Desktop.
scala xml memo
scala> val a: Option[String] = Some("msg")
a: Option[String] = Some(msg)
scala> <msg content={a orNull} />
warning: there was one feature warning; re-run with -feature for details
res3: scala.xml.Elem = <msg content="msg"/>
scala> val a: Option[String] = None
a: Option[String] = None
scala> <msg content={a orNull} />
warning: there was one feature warning; re-run with -feature for details
res4: scala.xml.Elem = <msg/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment