Hello Peter,

Oxygen uses the Epubcheck schemas for validating EPUB3/(X)HTML5.
Unfortunately this is a case of the HTML5 specification changing and the schemas not keeping up with the change.
The old HTML5 specs specifically forbid using http-equiv="content-type" in XML documents, while the new specs allow it.


Regarding the 'Encoding declaration state (http-equiv="content-type")' the W3C Candidate Recommendation from 17 December 2012 said:
http://www.w3.org/TR/2012/CR-html5-20121217/document-metadata.html#attr-meta-http-equiv-content-type
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.
However, since the 2013 CR and also in the current W3C Candidate Recommendation this has changed:
http://www.w3.org/TR/2013/CR-html5-20130806/document-metadata.html#attr-meta-http-equiv-content-type
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).

This is currently logged as a bug for the Epubcheck validator:
content-type value should be allowed for http-equiv attribute of meta tag
https://code.google.com/p/epubcheck/issues/detail?id=135


To keep a long story short(er), the simplest solution for this problem is to patch the schema to accept 'http-equiv="Content-Type"' (which is allowed  as per the latest HTML 5 specification). See the attached RNC schema file which patches this.
To apply this patch, save the 'html5-document-30.rnc' file locally and copy it to your Oxygen installation folder in:
Oxygen/frameworks/xhtml/xhtml5 (epub3)/mod/html5
Replace the existing file when prompted to. Depending on the location where Oxygen is installed you may need admin access to perform this operation.

To answer your questions:
Is it possible to circumvent the copy of the existing head subelements, including meta?
No, not without changing the output method to "xml". The meta is actually not a copy of the original, when you specify
<xsl:output method="xhtml"/>, Saxon serializes that meta in the output.

Why is the xslt so stubborn about http-equiv="Content-Type", when the validation rejects it for html5?
It's not its fault, really, it's the validation that shouldn't reject it.

Let us know if you need additional assistance.

Regards,
Adrian
Adrian Buza
oXygen XML Editor and Author Support

Tel: +1-650-352-1250 ext.2020
Fax: +40-251-461482
support@oxygenxml.com
http://www.oxygenxml.com

On 05.08.2014 12:23, Peter West wrote:
I'm transforming EPUB2 files to xhtml5 for EPUB3.

Here's the beginning of one of the EPUB2 files.
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
   <title>Personal Knowledge: Towards a Post-Critical Philosophy</title>
   <meta content="http://www.w3.org/1999/xhtml; charset=utf-8" http-equiv="Content-Type" />
	...
 </head>

My xsl file has, inter alia, this:

   <xsl:output method="xhtml" html-version="5"/>

When I do the transform, I get html5 output, including the meta element, like so:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
  <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     <title>Personal Knowledge: Towards a Post-Critical Philosophy</title>
	...
  </head>

Oxygen and Jing do not like
 http-equiv="Content-Type"

Uh-uh, no way.  They want Default-Style or Refresh, and nothing else will do.  I went through every contortion I could think of to recast teh meta element, to no avail.  I could generate a second meta element, but I could not get rid of the original meta.  I was as though that meta was hard coded into the html5 transformer.

So I have two questions.

Is it possible to circumvent the copy of the existing head subelements, including meta?
Why is the xslt so stubborn about http-equiv="Content-Type", when the validation rejects it for html5?

Peter West

"...the kingdom of heaven is like a merchant in search of fine pearls, who, finding one pearl of great value, sold all that he had and bought it."

Peter West

"...the kingdom of heaven is like a merchant in search of fine pearls, who, finding one pearl of great value, sold all that he had and bought it."

_______________________________________________
oXygen-user mailing list
oXygen-user@oxygenxml.com
http://www.oxygenxml.com/mailman/listinfo/oxygen-user