Howdy,
Try this at the Scala REPL (the Scala command line):
scala> if (true) <d/>

scala>

The type of a if expression (without and else) is always Unit.  Unit is
always blank in XML, and thus you never get anything.

Please change to if (true) <d/> else NodeSeq.Empty

scala> import scala.xml._
import scala.xml._

scala> if (true) <d/> else NodeSeq.Empty
res1: scala.xml.NodeSeq = <d></d>

And it works.

Thanks,

David

On Sun, Apr 26, 2009 at 3:51 AM, [email protected] <
[email protected]> wrote:

>
> Hi :
>
>  I want to ask why the <d/> won't appear in the following XML code.
>  And if I want to make such effect ? the "if" is inside an outer tag
> following by a previous tag, how could I do ?
>  Thanks
>
> scala> <br><cs/>{if(1==1) <d/>}</br>
> res26: scala.xml.Elem = <br><cs></cs></br>
>
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to