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

2013-10-31 Thread Jirka Kosek
On 28.10.2013 17:11, Bob Stayton wrote:
 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.

That's not entirely true. meta tag is generated when output method is
html or xhtml (xsl:output method=html|xhtml/). XSLT 1.0 doesn't
support xhtml output method so xml method is used instead which doesn't
generate meta tag.

If original poster is using Saxon, then best solution is to use
saxon:xhtml as an output method -- this makes xhtml output method
available in XSLT 1.0 as well.

Jirka

-- 
--
  Jirka Kosek  e-mail: ji...@kosek.cz  http://xmlguru.cz
--
   Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
--
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
--
Bringing you XML Prague conferencehttp://xmlprague.cz
--



signature.asc
Description: OpenPGP digital signature


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

2013-10-31 Thread Bob Stayton

Hi Jirka,
I just tested again with xhtml/docbook.xsl, and you are correct that Saxon 
does not output that meta tag when output method=xml, but xsltproc does 
with that stylesheet.  But xsltproc does so only when the XHTML DTD is 
specified. When the DTD reference is removed, as in xhtml5, then xsltproc 
does not.  If xsltproc is being used for xhtml5 output, then I think you 
would have to resort to manually adding that meta tag to the 
'user.head.content' template.


Bob Stayton
Sagehill Enterprises
b...@sagehill.net

--
From: Jirka Kosek ji...@kosek.cz
Sent: Thursday, October 31, 2013 10:22 AM
To: Bob Stayton b...@sagehill.net
Cc: Stefan Knorr skn...@suse.de; docbook-apps@lists.oasis-open.org; 
Robert Nagle idiotprogram...@gmail.com
Subject: Re: [docbook-apps] smart quotes are acting stupid in Firefox  IE; 
why?


On 28.10.2013 17:11, Bob Stayton wrote:

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.


That's not entirely true. meta tag is generated when output method is
html or xhtml (xsl:output method=html|xhtml/). XSLT 1.0 doesn't
support xhtml output method so xml method is used instead which doesn't
generate meta tag.

If original poster is using Saxon, then best solution is to use
saxon:xhtml as an output method -- this makes xhtml output method
available in XSLT 1.0 as well.

Jirka



-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org



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

2013-10-31 Thread Jirka Kosek
On 31.10.2013 19:28, Bob Stayton wrote:
 I just tested again with xhtml/docbook.xsl, and you are correct that
 Saxon does not output that meta tag when output method=xml, but
 xsltproc does with that stylesheet.  But xsltproc does so only when the
 XHTML DTD is specified. 

Hmm, that's interesting behaviour although probably not conforming to
XSLT 1.0 specification. I wasn't aware of that, I'm not using xsltproc
on regular basis.

 When the DTD reference is removed, as in xhtml5,
 then xsltproc does not.  If xsltproc is being used for xhtml5 output,
 then I think you would have to resort to manually adding that meta tag
 to the 'user.head.content' template.

Yep, but one has to take care to specify there same encoding as in
xsl:output/$chunker.output.encoding, otherwise output will be displayed
as mess again.

Jirka

-- 
--
  Jirka Kosek  e-mail: ji...@kosek.cz  http://xmlguru.cz
--
   Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
--
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
--
Bringing you XML Prague conferencehttp://xmlprague.cz
--



signature.asc
Description: OpenPGP digital signature


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

2013-10-28 Thread Stefan Knorr
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=1.0 encoding=UTF-8 standalone=no?
v/ 
 meta http-equiv=Content-Type
 content=text/html; charset=UTF-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.


-- 
SUSE LINUX GmbH, Maxfeldstraße 5, D-90409 Nürnberg
Geschäftsführer: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 21284 (AG Nürnberg)


signature.asc
Description: This is a digitally signed message part


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

2013-10-28 Thread Bob Stayton

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
b...@sagehill.net

--
From: Stefan Knorr skn...@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=3D1.0 encoding=3DUTF-8 standalone=3Dno?

v/=20

meta http-equiv=3DContent-Type
content=3Dtext/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.




-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org