html5 doctype and lift parsing

32 views
Skip to first unread message

greekscala

unread,
Nov 2, 2010, 6:46:20 PM11/2/10
to Lift
Hello Lift community,

I tried to use html5 for my project but lift complains and do not
renders
the template.

All my responses should be html5, so I used the code from the Assembla
wiki:
LiftRules.docType.default.set((r: Req) => r match {
case _ if S.skipDocType => Empty
case _ if S.getDocType._1 => S.getDocType._2
case _ => Full(DocType.html5)
})

Now when I define the html5 doctype in my template I get an error,
that whitespace is expected.
I know Lift wants to use xml, but I read here on the list that html5
is fine too.

How must the templates look like?

with best regards

David Pollak

unread,
Nov 2, 2010, 6:49:38 PM11/2/10
to lif...@googlegroups.com

All of Lift's templates must be valid XML.  HTML 5 supports well formed XML as well as the random HTML tags... if you're going to use HTML 5 with Lift, you still need to be sure your templates are well formed xml.
 

with best regards

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




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

greekscala

unread,
Nov 2, 2010, 7:11:19 PM11/2/10
to Lift
Hello David,

this was fast! Thank you. I did not know that.
When my template starts with a normal <html> tag it will not work.
Because of html5 I removed all the namespace declarations.
I added the lift namespace declaration but it still did not worked.
Firefox showed me the page as xml. After adding the standard namespace
again
(xmlns="http://www.w3.org/1999/xhtml") it worked.
I see in my firebug, the response has the right doctype html
definition as I configured Lift, ok.
But above this is the <?xml version="1.0" encoding="UTF-8"?>
declaration, is this expected?
Cannot tell if this is the problem why Firefox needed the default
namespace...

with best regards

On 2 Nov., 23:49, David Pollak <feeder.of.the.be...@gmail.com> wrote:
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
Reply all
Reply to author
Forward
0 new messages