You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Ben Gidley (JIRA)" <ji...@apache.org> on 2009/09/04 10:26:58 UTC
[jira] Created: (TAP5-840) Support character references in tml
files with HTML 5 Doctype
Support character references in tml files with HTML 5 Doctype
-------------------------------------------------------------
Key: TAP5-840
URL: https://issues.apache.org/jira/browse/TAP5-840
Project: Tapestry 5
Issue Type: Improvement
Components: tapestry-core
Affects Versions: 5.0.18
Reporter: Ben Gidley
Currently to support HTML character references (e.g. ©) you need to put a HTML Doctype at the top of the TML file.
e.g. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
However for HTML 5 they have stopped using XML doctypes and instead use
<!DOCTYPE html>
If you change tapestry page to use this you can no longer use entities as the XML parser doesn't know what to do.
Ideally there should be some kind of logic that detects <!DOCTYPE html> and include a suitable DTD to resolve the common HTML entities. The HTML 5 specification defines the allowed named character references - http://dev.w3.org/html5/spec/Overview.html#named-character-references. There doesn't seem to be a DTD of allowed references maintained anymore.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TAP5-840) Support character references in tml
files with HTML 5 Doctype
Posted by "Ben Gidley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752412#action_12752412 ]
Ben Gidley commented on TAP5-840:
---------------------------------
It does effect 5.1. Not sure about Trunk but I see no reason why it wouldn't.
> Support character references in tml files with HTML 5 Doctype
> -------------------------------------------------------------
>
> Key: TAP5-840
> URL: https://issues.apache.org/jira/browse/TAP5-840
> Project: Tapestry 5
> Issue Type: Improvement
> Components: tapestry-core
> Affects Versions: 5.0.18
> Reporter: Ben Gidley
>
> Currently to support HTML character references (e.g. ©) you need to put a HTML Doctype at the top of the TML file.
> e.g. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> However for HTML 5 they have stopped using XML doctypes and instead use
> <!DOCTYPE html>
> If you change tapestry page to use this you can no longer use entities as the XML parser doesn't know what to do.
> Ideally there should be some kind of logic that detects <!DOCTYPE html> and include a suitable DTD to resolve the common HTML entities. The HTML 5 specification defines the allowed named character references - http://dev.w3.org/html5/spec/Overview.html#named-character-references. There doesn't seem to be a DTD of allowed references maintained anymore.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TAP5-840) Support character references in tml
files with HTML 5 Doctype
Posted by "Massimo Lusetti (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752381#action_12752381 ]
Massimo Lusetti commented on TAP5-840:
--------------------------------------
Doesn't this affect 5.1 and trunk too?
> Support character references in tml files with HTML 5 Doctype
> -------------------------------------------------------------
>
> Key: TAP5-840
> URL: https://issues.apache.org/jira/browse/TAP5-840
> Project: Tapestry 5
> Issue Type: Improvement
> Components: tapestry-core
> Affects Versions: 5.0.18
> Reporter: Ben Gidley
>
> Currently to support HTML character references (e.g. ©) you need to put a HTML Doctype at the top of the TML file.
> e.g. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> However for HTML 5 they have stopped using XML doctypes and instead use
> <!DOCTYPE html>
> If you change tapestry page to use this you can no longer use entities as the XML parser doesn't know what to do.
> Ideally there should be some kind of logic that detects <!DOCTYPE html> and include a suitable DTD to resolve the common HTML entities. The HTML 5 specification defines the allowed named character references - http://dev.w3.org/html5/spec/Overview.html#named-character-references. There doesn't seem to be a DTD of allowed references maintained anymore.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (TAP5-840) Support character references in tml
files with HTML 5 Doctype
Posted by "Robin Komiwes (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-840?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robin Komiwes updated TAP5-840:
-------------------------------
Attachment: patch.txt
As I needed HTML5 for some projects, I made the fix.
I've explored many ways, such as DTDOverriding , custom external entity resolving...Without success. I also tried to use TemplateParserImpl.resolveEntity() and to add a hack for HTML5 like it's made for HTML4. But still no success.
Finally, I tried with XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES property set to false , a new TemplateToken implementation for entities, and it works.
Now, every entities, with or without a doctype set, are now simply output "as it".
I created a new symbol to offer the possibility to go back to the old system.
PFA the patch with tests.
> Support character references in tml files with HTML 5 Doctype
> -------------------------------------------------------------
>
> Key: TAP5-840
> URL: https://issues.apache.org/jira/browse/TAP5-840
> Project: Tapestry 5
> Issue Type: Improvement
> Components: tapestry-core
> Affects Versions: 5.0.18
> Reporter: Ben Gidley
> Attachments: patch.txt
>
>
> Currently to support HTML character references (e.g. ©) you need to put a HTML Doctype at the top of the TML file.
> e.g. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> However for HTML 5 they have stopped using XML doctypes and instead use
> <!DOCTYPE html>
> If you change tapestry page to use this you can no longer use entities as the XML parser doesn't know what to do.
> Ideally there should be some kind of logic that detects <!DOCTYPE html> and include a suitable DTD to resolve the common HTML entities. The HTML 5 specification defines the allowed named character references - http://dev.w3.org/html5/spec/Overview.html#named-character-references. There doesn't seem to be a DTD of allowed references maintained anymore.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TAP5-840) Support character references in tml
files with HTML 5 Doctype
Posted by "Massimo Lusetti (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752381#action_12752381 ]
Massimo Lusetti commented on TAP5-840:
--------------------------------------
Doesn't this affect 5.1 and trunk too?
> Support character references in tml files with HTML 5 Doctype
> -------------------------------------------------------------
>
> Key: TAP5-840
> URL: https://issues.apache.org/jira/browse/TAP5-840
> Project: Tapestry 5
> Issue Type: Improvement
> Components: tapestry-core
> Affects Versions: 5.0.18
> Reporter: Ben Gidley
>
> Currently to support HTML character references (e.g. ©) you need to put a HTML Doctype at the top of the TML file.
> e.g. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> However for HTML 5 they have stopped using XML doctypes and instead use
> <!DOCTYPE html>
> If you change tapestry page to use this you can no longer use entities as the XML parser doesn't know what to do.
> Ideally there should be some kind of logic that detects <!DOCTYPE html> and include a suitable DTD to resolve the common HTML entities. The HTML 5 specification defines the allowed named character references - http://dev.w3.org/html5/spec/Overview.html#named-character-references. There doesn't seem to be a DTD of allowed references maintained anymore.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (TAP5-840) Support character references in tml
files with HTML 5 Doctype
Posted by "Robin Komiwes (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-840?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robin Komiwes updated TAP5-840:
-------------------------------
Attachment: patch.txt
As I needed HTML5 for some projects, I made the fix.
I've explored many ways, such as DTDOverriding , custom external entity resolving...Without success. I also tried to use TemplateParserImpl.resolveEntity() and to add a hack for HTML5 like it's made for HTML4. But still no success.
Finally, I tried with XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES property set to false , a new TemplateToken implementation for entities, and it works.
Now, every entities, with or without a doctype set, are now simply output "as it".
I created a new symbol to offer the possibility to go back to the old system.
PFA the patch with tests.
> Support character references in tml files with HTML 5 Doctype
> -------------------------------------------------------------
>
> Key: TAP5-840
> URL: https://issues.apache.org/jira/browse/TAP5-840
> Project: Tapestry 5
> Issue Type: Improvement
> Components: tapestry-core
> Affects Versions: 5.0.18
> Reporter: Ben Gidley
> Attachments: patch.txt
>
>
> Currently to support HTML character references (e.g. ©) you need to put a HTML Doctype at the top of the TML file.
> e.g. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> However for HTML 5 they have stopped using XML doctypes and instead use
> <!DOCTYPE html>
> If you change tapestry page to use this you can no longer use entities as the XML parser doesn't know what to do.
> Ideally there should be some kind of logic that detects <!DOCTYPE html> and include a suitable DTD to resolve the common HTML entities. The HTML 5 specification defines the allowed named character references - http://dev.w3.org/html5/spec/Overview.html#named-character-references. There doesn't seem to be a DTD of allowed references maintained anymore.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TAP5-840) Support character references in tml
files with HTML 5 Doctype
Posted by "Ben Gidley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TAP5-840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752412#action_12752412 ]
Ben Gidley commented on TAP5-840:
---------------------------------
It does effect 5.1. Not sure about Trunk but I see no reason why it wouldn't.
> Support character references in tml files with HTML 5 Doctype
> -------------------------------------------------------------
>
> Key: TAP5-840
> URL: https://issues.apache.org/jira/browse/TAP5-840
> Project: Tapestry 5
> Issue Type: Improvement
> Components: tapestry-core
> Affects Versions: 5.0.18
> Reporter: Ben Gidley
>
> Currently to support HTML character references (e.g. ©) you need to put a HTML Doctype at the top of the TML file.
> e.g. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> However for HTML 5 they have stopped using XML doctypes and instead use
> <!DOCTYPE html>
> If you change tapestry page to use this you can no longer use entities as the XML parser doesn't know what to do.
> Ideally there should be some kind of logic that detects <!DOCTYPE html> and include a suitable DTD to resolve the common HTML entities. The HTML 5 specification defines the allowed named character references - http://dev.w3.org/html5/spec/Overview.html#named-character-references. There doesn't seem to be a DTD of allowed references maintained anymore.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.