HTML5 and Composite C1

Topics: Feature requests, General, Visual editor
Mar 3, 2011 at 11:59 PM

Is is recommended to use HTML5 with Composite C1?

If I'm not mistaken, XSLT templates require XML... so you'd have to serve xHTML5... and as far as I can gather, IE doesn't do XHTML5.

Am I totally off base, here?

Mar 4, 2011 at 1:22 AM
Edited Mar 4, 2011 at 1:23 AM

We have the folllowing known issues with html5

  • the SEO assistant will not locate keywords wrapped in html5 specific elements
  • the visual html editor does not support html5 specific elements

You should be good to go with html 5 if you can live without the SEO assistant (for now) and your users are not required to build up html 5 based page content in the WYSIWYG editor.

Your layout templates, XSLTs, Web Forms, MVC views etc. can emit html 5 just fine.

AFAIK html 5 documents can be both 'XML' and 'sloppy' so the fact that Composite C1 is 'XML' should not be a problem. You should be able to get there by just adding the doctype and then use the tags you want.

If you find more html5 issues than the two listed above, please post about it.

Mar 4, 2011 at 5:28 PM

I assume you mean the standard HTML DOCTYPE, <!DOCTYPE html>

Instead of this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" xmlns:f="" xmlns:lang="" xmlns:rendering="" xmlns:asp="">

For HTML5:

<!DOCTYPE html>
<html xmlns="" xmlns:f="" xmlns:lang="" xmlns:rendering="" xmlns:asp="">

Mar 11, 2011 at 8:17 PM

I noticed that when you remove the XML Namespace xmlns="" from the <html> tag, the composite system doesn't seem to recognize the layout and no server side stuff is done.

HTML5 doesn't require the xmlns because HTML5 is by default in that namespace. This is what I have and it works:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="" xmlns:f="" xmlns:lang="" xmlns:rendering="" xmlns:asp="">


It would be really nice to see a list of gotchas when it comes to HTML5 and Composite C1

Mar 11, 2011 at 8:43 PM

Since the rendering of all our C1 websites is done through the use of ASP.NET Master Pages we don't have this problem. But it should be an easy fix to attach a Filter that will remove the namespace from the <html> tag before the content is sent to the client.

  • Create a class that inherits from Stream 
  • Overwrite its Write-method and do a seach&replace on the html-tag
  • In global.asax you subscribe to the PostHandlerExecuteRequest event of the HttpApplication instance
  • Make sure the current handler is the composite page class
  • Attach your own stream-class to Response.Filter

Mar 11, 2011 at 9:11 PM

Yeah, it's not a huge deal, just interesting.

How did you find the transition to using Master Pages? This is a pattern that I'm definitely used to, and I've seen some documentation on it here, but were there many roadblocks that you ran into?

Were there things that didn't work in the Composite C1 ecosystem?

Would love to see any references that you used.

Mar 11, 2011 at 9:17 PM
Edited Mar 11, 2011 at 9:23 PM

well, im the one behind so i would love to hear if you're having problems using it.

Using Master Pages is very simple and the implementation in CompositeC1Contrib simply relies on a .master file being present with the same name as the Template in C1. If its not there, it will default back to using normal XLST Template rendering so the two methods can easily co-exist. 

Hopefully this will make into C1 very soon... 2.1 just had to get out the door with the scheduled features so we can look forward on new exciting stuff. A pure MVC rendering engine is also on the drawing board.

Apr 14, 2011 at 1:18 PM

Should we have a separate topic for html5? There are a few small things (or not so small) we've come across so far, and it might be good to segment it all off?