What DTD to use in JSF with HTML5 tags

4

Generally, when I make a JSF page with XHTML, I use the DTD for XHTML 1.0 Transitional.

However, if I use the namespace and put some HTML5 tags (passtrough elements / attributes), which DTD should I use?

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:jsf="http://xmlns.jcp.org/jsf"
    xmlns:pt="http://xmlns.jcp.org/jsf/passthrough">
    <h:body>
        <input jsf:id="algumaID"/>
        <h:inputText pt:placeholder="algum texto"/>
    </h:body>
</html>

XHTML (page.xhtml)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

or HTML5 (page.html)?

<!DOCTYPE html>
    
asked by anonymous 13.03.2015 / 14:43

2 answers

1

XHTML was based on html 4. Therefore its syntax does not support things like required, special inputs like date, number or other html5 facilities.  We come from the front end, look forward to the new jsf with support for it.

    
15.04.2015 / 22:09
0

You can put any of the two, I personally use the HTML5

<!DOCTYPE html>

Even though it does not matter, JSF 2.2 will always place it, regardless of what's in your xhtml file. As you can see in this article

    
14.04.2017 / 21:47