Yes, the default output encoding for XHTML is UTF-8 (see the xsl:output
element in xhtml/docbook.xsl). All modern browsers handle UTF-8 if they
interpret the file correctly. The problem is when a http server indicates
that the document is some other encoding, then that confuses some browers.
Try browsing the files locally and you'll see that they work.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
[EMAIL PROTECTED]
----- Original Message -----
From: "Anthony Ettinger" <[EMAIL PROTECTED]>
To: "Bob Stayton" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Tuesday, October 30, 2007 7:47 PM
Subject: Re: [docbook] invalid characters for ISO-8859-1 response
Ok, if that's the case, then the assumption is that xhtml outputted is
UTF-8 encoded? Seems odd that would be a requirement to be viewed
properly in a browser.
The   gets converted into its character at transformation time,
right?
On 10/30/07, Bob Stayton <[EMAIL PROTECTED]> wrote:
Hi Anthony,
I think if you look again, you will see that the nobreak spaces are not
replacing spaces within your titles, but appear only before and after
the
chapter number. The intention was to keep the chapter label, number,
and
first word of the chapter title together.
These non-breaking spaces are defined in the gentext files for each
language, such as common/en.xml. These files are used for both the HTML
and FO outputs. You can customize them to use plain spaces if you like.
You will see lines like this, where   should be replaced with a
regular space.
<l:template name="chapter" text="Chapter %n. %t"/>
See this reference for information on customizing the gentext strings
http://www.sagehill.net/docbookxsl/CustomGentext.html
Bob Stayton
Sagehill Enterprises
DocBook Consulting
[EMAIL PROTECTED]
----- Original Message -----
From: "Anthony Ettinger" <[EMAIL PROTECTED]>
To: "Bob Stayton" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Tuesday, October 30, 2007 5:05 PM
Subject: Re: [docbook] invalid characters for ISO-8859-1 response
> That answers the question about how to change the output
> encoding...but why is it inserting a non-breaking space
> character...vs. just a regular old space (as is the input).
>
> Why does "Some Title" become "Some<nobr-space-char>Title"??
>
> It should just remain.
>
> I think i've traced it down to normalize-space(); but not sure:
>
> ./common/gentext.xsl
>
> <xsl:template match="*" mode="object.title.markup.textonly">
> <xsl:variable name="title">
> <xsl:apply-templates select="." mode="object.title.markup"/>
> </xsl:variable>
> <xsl:value-of select="normalize-space($title)"/>
> </xsl:template>
>
>
>
> On 10/30/07, Bob Stayton <[EMAIL PROTECTED]> wrote:
>> Hi Anthony,
>> The special characters you are seeing are non-breaking spaces.
>>
>> As you discovered changing the input encoding has no effect on the
>> output
>> encoding, since they are independent of each other.
>>
>> Are you chunking your HTML output? If so, then changing the output
>> encoding is easy. See this reference:
>>
>> http://www.sagehill.net/docbookxsl/Chunking.html#ChunkEncoding
>>
>> If you are using single-file HTML output, then you have to set the
>> encoding
>> attribute in an xsl:output element in your stylesheet customization
>> layer
>> to change the output encoding.
>>
>> Bob Stayton
>> Sagehill Enterprises
>> DocBook Consulting
>> [EMAIL PROTECTED]
>>
>>
>> ----- Original Message -----
>> From: "Anthony Ettinger" <[EMAIL PROTECTED]>
>> To: <[email protected]>
>> Sent: Tuesday, October 30, 2007 12:49 PM
>> Subject: [docbook] invalid characters for ISO-8859-1 response
>>
>>
>> > If I do the docbook -> xhtml transformation (v 4.4) I get invalid
>> > characters for the chapter numbers in the output. If I change the
>> > character encoding in the browser view from ISO-8859-1 to UTF-8
>> > they
>> > look ok.
>> >
>> > I have to use ISO-8859-1 for now, because that's what the server
>> > sends
>> > the response as...also, I'm unclear why there are special
>> > characters
>> > at all in the output just to display chapter numbers:
>> >
>> > output:
>> > <h2 class="title"><a id="reports"></a>Chapter?| 3.?| Reports</h2>
>> >
>> > Note the "Chapter?|3.?|Reports" (this is from vim when I view the
>> > source directly, I get the "A-hat" character when viewing source in
>> > the browser.
>> >
>> > How should I fix this problem, all I really need is a space..no
>> > special character to represent "Chapter 3. Reports" should be
>> > needed
>> > here.
>> >
>> > I tried changing the xml charset in the xml declaration, but that
>> > didn't do anything.
>> >
>> > --
>> > Anthony Ettinger
>> > Ph: 408-656-2473
>> > var (bonita, farley) = new Dog;
>> > farley.barks("very loud");
>> > bonita.barks("at strangers");
>> >
>> > http://chovy.dyndns.org/resume/
>> > http://utuxia.com/consulting
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>>
>>
>
>
> --
> Anthony Ettinger
> Ph: 408-656-2473
> var (bonita, farley) = new Dog;
> farley.barks("very loud");
> bonita.barks("at strangers");
>
> http://chovy.dyndns.org/resume/
> http://utuxia.com/consulting
>
>
--
Anthony Ettinger
Ph: 408-656-2473
var (bonita, farley) = new Dog;
farley.barks("very loud");
bonita.barks("at strangers");
http://chovy.dyndns.org/resume/
http://utuxia.com/consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]