In How to include another XHTML in XHTML using JSF 2.0 Facelets? BalusC states that
any tags outside <ui:composition> are unnecessary as they are ignored by Facelets anyway
Now I wonder if the same holds for composite components? Is it valid to omit the HTML tags and the doctype declaration in the following example code?
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:composite="http://java.sun.com/jsf/composite">
<composite:interface>
<composite:attribute name="title" />
</composite:interface>
<composite:implementation>
<h:outputText value="#{cc.attrs.title}" />
...
</composite:implementation>
</html>