xsltproc and DocBook

Discussion in 'XML' started by Darel Finkbeiner, Mar 21, 2007.

  1. This may be the wrong group, so let me know.

    My "problem" is this: I am writing my commentary in DocBook 5 and
    using the program xsltproc and the docbook5 XSL stylesheets to produce
    XHTML output. Since it is a commentary, it has both English and
    polytonic Greek with combining diacritics in it. My console and VIM
    are both perfectly configured to allow me to edit such documents in a
    very natural and easy way, and one in which I can actually read the
    Greek that I've typed in.

    After processing with xsltproc, all of my beautiful UTF-8 encoded
    Greek is being transformed into butt-ugly entity references.

    Now, I suppose, "technically speaking", this isn't an issue when
    viewing the html document in a browser.... maybe. But I like to be
    able to view and "debug" the resulting file in a text editor as I want
    to ... additionally, how am I to be sure that the "correct" UTF-8
    code points are being used for crucial combining marks ( and by
    "correct", I mean the exact code points that I have chosen to use,
    since there are alternatives in the unicode standard )? I
    specifically chose XHTML output because it is natively UTF-8, so why
    convert them to entities in the first place?

    My question is, how do I turn off this "feature"? Or can I? Or
    should I use a different XSLT processor?
    Darel Finkbeiner, Mar 21, 2007
    #1
    1. Advertising

  2. Did you specify UTF-8 as your output encoding in the xsl:eek:utput directive?

    If you did, and you're still getting everything converted to character
    references... you may want to try another XSLT processor and see if its
    serializer does a better job of taking advantage of UTF-8.

    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
    Joseph Kesselman, Mar 21, 2007
    #2
    1. Advertising

  3. On Mar 21, 9:52 am, Joseph Kesselman <>
    wrote:
    > Did you specify UTF-8 as your output encoding in the xsl:eek:utput directive?
    >
    > If you did, and you're still getting everything converted to character
    > references... you may want to try another XSLT processor and see if its
    > serializer does a better job of taking advantage of UTF-8.
    >
    > --
    > Joe Kesselman / Beware the fury of a patient man. -- John Dryden


    It looks like the output method in the XSL stylesheet sets the
    encoding correctly.....

    <xsl:eek:utput method="xml" encoding="UTF-8" indent="no" doctype-
    public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://
    www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>

    Any suggestions on a good XSLT processor?
    Darel Finkbeiner, Mar 21, 2007
    #3
  4. "Darel Finkbeiner" <> writes:

    > My question is, how do I turn off this "feature"? Or can I? Or
    > should I use a different XSLT processor?


    You may try to not even mention XHTML in <xsl:eek:utput> (make a new
    "driver" xslt stylesheet, with only <xsl:eek:utput> and <xsl:include> of
    the other xsl). xsltproc should not use any entity then.

    -- Alain.
    Alain Ketterlin, Mar 22, 2007
    #4
  5. On Mar 22, 3:55 am, Alain Ketterlin <-strasbg.fr>
    wrote:
    > "Darel Finkbeiner" <> writes:
    > > My question is, how do I turn off this "feature"? Or can I? Or
    > > should I use a different XSLT processor?

    >
    > You may try to not even mention XHTML in <xsl:eek:utput> (make a new
    > "driver" xslt stylesheet, with only <xsl:eek:utput> and <xsl:include> of
    > the other xsl). xsltproc should not use any entity then.
    >
    > -- Alain.


    Amazing... you were absolutely correct. I changed the output to:

    <xsl:eek:utput method="xml" encoding="UTF-8"/>

    And suddenly it worked perfectly. Thanks for the tip, Alain!
    Darel Finkbeiner, Mar 22, 2007
    #5
  6. Darel Finkbeiner wrote:
    > Amazing... you were absolutely correct. I changed the output to:
    > <xsl:eek:utput method="xml" encoding="UTF-8"/>
    > And suddenly it worked perfectly. Thanks for the tip, Alain!


    Note that method="xhtml" is actually not defined in the XSLT 1.0
    standard... but since XHTML is an XML language, outputting as XML should
    work.

    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
    Joseph Kesselman, Mar 22, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brett

    xsltproc and Entities

    Brett, Feb 27, 2004, in forum: XML
    Replies:
    1
    Views:
    908
    Alain Ketterlin
    Mar 1, 2004
  2. Antonio Amato
    Replies:
    2
    Views:
    1,268
    Michael Wiedmann
    Nov 18, 2004
  3. Arndt Jonasson

    xsltproc and multiple-line text

    Arndt Jonasson, Apr 25, 2007, in forum: XML
    Replies:
    1
    Views:
    877
    Joseph Kesselman
    Apr 25, 2007
  4. Replies:
    1
    Views:
    522
    Joseph Kesselman
    Nov 27, 2007
  5. Glen Millard
    Replies:
    10
    Views:
    1,527
    Peter Flynn
    Mar 12, 2012
Loading...

Share This Page