Or toSeq instead of toList. And if it still doesn't work surround it with NodeSeq.fromSeq(....toSeq)
------------------------------------- David Pollak<[email protected]> wrote: try tacking a .toList on after the flatMap() expression. On Tue, Oct 6, 2009 at 3:19 PM, rstradling <[email protected]> wrote: > > Hello everyone, > I have the following code... > case class item(name : String) > class demo { > def exampleFour(xhtml : NodeSeq) : NodeSeq = { > val map = Map("Test" -> List(item("1"), item("2"), item("3")), > "Vehicles" -> List(item("Bike"), item("Automobile")) > ) > val articles = List( > article("A bunch of text", List(tag("Health"), > tag("Hurt"))), > article("BODY", List(tag("Coming"))) > ) > map.flatMap(a => bind("a", xhtml, > "body" -> Text(a._1), > "tags" -> a._2.flatMap(t => > bind("t", chooseTemplate("tag", "list", xhtml), > "name" -> Text(t.name)) > ) > ) > ) > } > } > > And I get this error message... > C:\Java\helloworld\src\main\scala\demo\helloworld\snippet\demo.scala: > 46: error: type mismatch; > found : Iterable[scala.xml.Node] > required: scala.xml.NodeSeq > map.flatMap(a => bind("a", xhtml, > ^ > one error found > > I am not sure how to get around this. I realize I have different > types but am not sure how they are related and how to convert one to > the other. I googled for some answers and found stuff related to > Scala 2.8 but am not sure that applies to my situation. > > I am using Scala 2.7.5 and Lift 1.1-M5. > > Thanks for the help. > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
