jacshore / epubcheck

Automatically exported from code.google.com/p/epubcheck
MIT License
0 stars 0 forks source link

content-type value should be allowed for http-equiv attribute of meta tag #135

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
PROBLEM:

<meta http-equiv="content-type" content="text/html; charset=UTF-8"> tag is 
throwing error. But as per the specification content-type value is allowed for 
http-equiv attribute.

However there is another way of representing charset using <meta 
charset="utf-8"/> tag. It is not throwing error.

METHOD:

What steps will reproduce the problem?
1. add <meta http-equiv="content-type" content="text/html; charset=UTF-8">  to 
any XHTML file and execute epubcheck-3.0b3.jar
2.
3.

RESULT:

ERROR: 9780316000000_MobyDick_r9.epub/OPS/chapter_127.xhtml(5,69): value of 
attribute "http-equiv" is invalid; must be a string matching the regular 
expression 
"([Dd][Ee][Ff][Aa][Uu][Ll][Tt]\-[Ss][Tt][Yy][Ll][Ee])|([Rr][Ee][Ff][Rr][Ee][Ss][
Hh])"

EXPECTED:

It should not show error for content-type attribute value for http-equiv 
attribute.

PLATFORM:

epubcheck-3.0b3.jar on Win XP

ADDITIONAL INFO:

Please provide any additional information below.

Original issue reported on code.google.com by nbabugan...@gmail.com on 3 Nov 2011 at 12:01

GoogleCodeExporter commented 8 years ago
omg I hope they fix this 

it's flooding the terminal and making it hard to find real errors

Original comment by biggmacb...@gmail.com on 6 Nov 2011 at 7:15

GoogleCodeExporter commented 8 years ago
Hi.
I made this modification on my own version (see below). 
That works, but I'd like to have developer's advice on this point.
Was it a mistake, or willingly done for a reason ?
Joel
_________________________________________________________
File: 
com.adobe.epubcheck\src\com\adobe\epubcheck\schema\30\mod\html5\html5-document-3
0.rnc
Ligne: 36
Replaced by:    html5.meta.http-equiv.attr.content = xsd:string { pattern = 
"([Cc][Oo][Nn][Tt][Ee][Nn][Tt]\-[Tt][Yy][Pp][Ee]|[Dd][Ee][Ff][Aa][Uu][Ll][Tt]\-[
Ss][Tt][Yy][Ll][Ee])|([Rr][Ee][Ff][Rr][Ee][Ss][Hh])" }
__________________________________________________________

Original comment by schvar...@gmail.com on 13 Dec 2011 at 9:07

GoogleCodeExporter commented 8 years ago
The "bad news" is the following statement in section 4.2.5.3 in the html5 spec: 
"The Encoding declaration state may be used in HTML documents, but elements 
with an http-equiv attribute in that state must not be used in XML documents." 
(http://dev.w3.org/html5/spec/Overview.html#pragma-directives)

This essentially means that the current epubcheck release is correct, all 
whilst regretfully being a terminal flooder. 

Could any of you clarify the motivation for including this meta element in EPUB 
content docs?

Original comment by markus.g...@gmail.com on 13 Dec 2011 at 8:38

GoogleCodeExporter commented 8 years ago
Hi Markus, and many thanks for beeing so reactive.
For my part, no real motivation, just an habit ....
We'll change that, and stick to the specs !

Joel

Original comment by schvar...@gmail.com on 14 Dec 2011 at 9:01

GoogleCodeExporter commented 8 years ago
For all who run into this: one trick is to use <meta charset="utf-8" /> instead.

Original comment by markus.g...@gmail.com on 15 Jan 2012 at 3:53

GoogleCodeExporter commented 8 years ago

Original comment by markus.g...@gmail.com on 15 Jan 2012 at 4:31

GoogleCodeExporter commented 8 years ago
This issue was closed in Jan 2012 but since then the standard has been updated 
and I believe makes this issue a valid issue and an bug in ePubCheck.

Up to Draft 28 (May 2013) the statement was:-
http://www.w3.org/TR/2013/WD-html51-20130528/document-metadata.html#pragma-direc
tives
"The Encoding declaration state may be used in HTML documents, but elements 
with an http-equiv attribute in that state must not be used in XML documents."

Which is contradictory as <meta http-equiv="content-type" 
content="application/xhtml+xml" /> is required to make the intended XHTML5 
file. Else it is technically a HTML5 file that is still valid as it accepts the 
'look' of a XHTML5 file but may not be parsed/validated correctly by XML 
engines.

After that (Draft 29 (October 2013) to Current) the statement is:-
http://www.w3.org/TR/2013/WD-html51-20131029/document-metadata.html#pragma-direc
tives 
"The encoding declaration state may be used in HTML documents and in XML 
Documents. If the encoding declaration state is used in XML Documents, the name 
of the character encoding must be an ASCII case-insensitive match for the 
string "UTF-8" (and the document is therefore forced to use UTF-8 as its 
encoding)."

The full valid options would be:-
<meta http-equiv="content-type" content="application/xhtml+xml" charset="utf-8" 
/>

Wouldn't it?

Regards
Gary

Original comment by Gary.Eva...@gmail.com on 16 Jul 2014 at 1:33