OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] smart quotes are acting stupid in Firefox & IE; why?


Hi,
I looked into this some more. Seeing strange characters in DocBook XHTML output usually means the browser thinks the file has iso-8859-1 encoding instead of the UTF-8 encoding that is the DocBook XHTML default. It is the case that browsers should read either the encoding attribute of the XML declaration in the output file (which DocBook XSL does set), or this meta element:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

The DocBook xhtml stylesheet does not have to output this meta element because the XSLT processors automatically insert it in each output file in the <head> element.

But I also found that when processing with the xhtml5 stylesheet instead of xhtml, that <meta> element is *not* output automatically (and the epub3 stylesheet is based on xhtml5). I thought that was odd, since the xhtml5 stylesheet imports from the xhtml directory. By experimentation, I found that the crucial difference is that the xhtml5 stylesheet does not set the doctype attributes in the xsl:output element, because the XHTML5 standard does not support a DTD. Apparently xsltproc and Saxon relied on the doctype attributes to generate that encoding meta element.

I tried putting that <meta> element in the epub3 output files, but epubcheck version 3 objected. It should be ok in XHMTL5 output intended for browsing, but not for EPUB3. But EPUB3 readers don't need it, so I think you will have to live with the odd characters when browsing the epub3 output with those HTML browsers.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net

--------------------------------------------------
From: "Stefan Knorr" <sknorr@suse.de>
Sent: Monday, October 28, 2013 4:37 AM
To: <docbook-apps@lists.oasis-open.org>
Subject: Re: [docbook-apps] smart quotes are acting stupid in Firefox & IE; why?

Hi Robert,

On Fr, 2013-10-25 at 22:23 -0500, Robert Nagle wrote:
As you know, MS Word automatically changes quotes to smart quotes and so =
my
docbook source in Oxygen editor includes smart quotes and not normal
quotes.

I think the best way to generate quotes in DocBook is using the <quote>
element -- that way you get whatever quotes are most appropriate for the
target language automatically in your output.


(generously snipped...)
<?xml version=3D"1.0" encoding=3D"UTF-8" standalone=3D"no"?>
v/=20
<meta http-equiv=3D"Content-Type"
content=3D"text/html; charset=3DUTF-8" />

It's not really the same -- your Wordpress instance uses the meta
element while your DocBook processor writes it in the XML declaration.
Seeing as only one of the two works, browsers probably need the the meta
element version.

Stefan.





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]