I have this use case where an index.xhtml page is created by a JavaScript framework. This page contains following element:
<link rel="stylesheet" href="/design/style/sheet/css-effects.css">
The page starts with following doctype, which is standard for HTML5 documents:
<!DOCTYPE html>
When this file then gets parsed by JSF 2.3, it generates following error:
javax.servlet.ServletException: Error Parsing /index.xhtml: Error Traced[line: 22] The element type "link" must be terminated by the matching end-tag "</link>"
However, JSF 2.3 states that it is HTML5 compatible. There are many articles about it on the internet.
When I then go to the definition of the HTML5 link element, it clearly states that the link element can be used as generated above, meaning with only '>' at the end, and not with '/>' or a complete closing tag like '>':
https://html.spec.whatwg.org/multipage/semantics.html#the-link-element
Thus, in fact the JavaScript generates correct HTML5 syntax following the standards. And apparently JSF cannot handle correct HTML5 syntax. It not only happens with the link element, but also with img and so on... Elements that will never have content in fact.
So, my question is: is it true that JSF 2.3 in the end is not fully compatible with HTML5, but only partially? Is there a way to bypass this behaviour of JSF to refuse HTML5 compatible elements or should I configure something? Or am I completely missing something important here?
It is important for me to know, because I have no control on how the JavaScript framework generates html files. And in the end, they are formatted correctly.