Adding omit-xml-declaration="yes" to the xsl:output should take care of the first problem.

Regarding the meta tag, can I ask if you are using xsltproc? That tag is not generated by the stylesheet, but by xsltproc when the output public doctype matches the public id of an XHTML DTD. It seems to be a built-in feature, and always uses the declared output encoding.

Why doesn't encoding="ISO-8859-1" in your xsl:output work? Why is US-ASCII necessary?

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 9:57 PM
Subject: Re: [docbook] invalid characters for ISO-8859-1 response


Converting the output type to US-ASCII gives me what I want, except
for the <?xml?> declaration line (and content-type meta tag, which
need to be IS0-8859-1

This:
<xsl:output method="xml" encoding="US-ASCII" indent="no"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>

Gives me this (correct):
<h2 class="title"><a id="accounts"></a>Chapter&#160;4.&#160;Accounts</h2>

But I don't want this line at all (throws IE into "Quirks Mode"):
<?xml version="1.0" encoding="US-ASCII"?>

And this should be IS0-8859-1
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII" />



On 10/30/07, Anthony Ettinger <[EMAIL PROTECTED]> wrote:
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 &#160; 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 &#160; should be replaced with a
> regular space.
>
> <l:template name="chapter" text="Chapter&#160;%n.&#160;%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



--
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]

Reply via email to