You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Paul van Rossem (JIRA)" <de...@myfaces.apache.org> on 2008/02/08 08:23:11 UTC

[jira] Commented: (TRINIDAD-922) Add a switch to allowing to generate XHTML STRICT or TRANSITIONAL DOCTYPE

    [ https://issues.apache.org/jira/browse/TRINIDAD-922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12566940#action_12566940 ] 

Paul van Rossem commented on TRINIDAD-922:
------------------------------------------

The <tr:document> tag always generates a HTML DOCTYPE, not XHTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
which doesn't allow selfclosing meta and link tags (which are XHTML syntax).

However the following jsf (with unclosed HTML tags) causes the Trinidad parser to throw (in violation with the DOCTYPE it generated itself):

<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root version="2.0"
 xmlns:jsp="http://java.sun.com/JSP/Page"   
 xmlns:f="http://java.sun.com/jsf/core"
 xmlns:h="http://java.sun.com/jsf/html"     
 xmlns:tr="http://myfaces.apache.org/trinidad">
<jsp:directive.page contentType="text/html; charset=utf-8"/>
 <f:view>
   <tr:document title="my title">
     <f:facet name="metaContainer">
       <link rel="stylesheet" type="text/css" href="/styles.css"> <!-- note: link is not closed -->
     </f:facet>             
     <p>my body</p>
   </tr:document>
 </f:view>
</jsp:root>

SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /trdoc.jsp(12,9) The element type "link" must be terminated by the matching end-tag
"</link>".

But if the <link> is closed, as the Trinidad parser requires, invalid HTML is generated for that DOCTYPE. So, strictly speaking, it is no way possible to generate valid HTML or XHTML, only a mix of both, which doesn't pass any validation at all (like validator.w3.org). Luckily all known browser have no problem with that...

> Add a switch to <tr:document> allowing to generate XHTML STRICT or TRANSITIONAL DOCTYPE
> ---------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-922
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-922
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>            Reporter: Paul van Rossem
>
> Now always the default HTML DOCTYPE is output by the <tr:document> tag. This does not allow to validate the output as XHTML.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.