docbook-apps

  • 1.  html/epub3 stylesheet bug

    Posted 07-02-2014 16:08
    hi,
    I'm using this type of processing instruction in my docbook 5 source:

    and the docs say that the wrapper inside the external doc will be
    removed, if I understand it correctly:
    http://www.sagehill.net/docbookxsl/InsertExtHtml.html

    However, here is a test file that does not remove the 'html' wrapper:

    -------- db.xml ---------
    <chapter xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="new" >
    <info></info>
    <para>

    <info></info>

    </para>
    </chapter>

    ------ output.htm -------





    Output



    stuff






    The tags are present inside the html file resulting from either of
    these commands:

    xsltproc docbook/xsl-1.78.1/html/chunk.xsl db.xml
    xsltproc docbook/xsl-1.78.1/epub3/chunk.xsl db.xml

    Maybe I'm missing a parameter or this is a bug?
    thanks,
    --Tim



  • 2.  Re: [docbook-apps] html/epub3 stylesheet bug

    Posted 07-02-2014 16:40
    Hi Tim,
    Indeed, this is a bug in the namespaced version of the stylesheets.

    When the namespaced version is generated from the non-namespaced
    version, this line:

    <xsl:when test="$content/*[1][self::html]">

    gets converted to this line:

    <xsl:when test="$content/*[1][self::d:html]">

    because it thinks html is a DocBook element name. But of course, your
    html element is not in the DocBook namespace, so this test fails and the
    element is passed through.

    I need to patch the conversion process to fix this. The workaround for
    you is to copy the template named "pi.dbhtml-include" from xhtml/pi.xsl
    to your customization layer and remove the "d:" prefix.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net

    On 7/2/2014 9:08 AM, Tim Arnold wrote:
    > hi,
    > I'm using this type of processing instruction in my docbook 5 source:
    >
    > and the docs say that the wrapper inside the external doc will be
    > removed, if I understand it correctly:
    > http://www.sagehill.net/docbookxsl/InsertExtHtml.html
    >
    > However, here is a test file that does not remove the 'html' wrapper:
    >
    > -------- db.xml ---------
    > <chapter xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="new" >
    > <info></info>
    > <para>
    >

    > <info></info>
    >

    > </para>
    > </chapter>
    >
    > ------ output.htm -------
    >
    >

    >

    >
    >
    >
    Output

    >

    >

    stuff


    >

    >

    >
    >
    > The tags are present inside the html file resulting from either
    > of these commands:
    >
    > xsltproc docbook/xsl-1.78.1/html/chunk.xsl db.xml
    > xsltproc docbook/xsl-1.78.1/epub3/chunk.xsl db.xml
    >
    > Maybe I'm missing a parameter or this is a bug?
    > thanks,
    > --Tim
    >



  • 3.  Re: [docbook-apps] html/epub3 stylesheet bug

    Posted 07-02-2014 16:49
    Thanks Bob! will do.
    --Tim



    On Wed, Jul 2, 2014 at 12:40 PM, Bob Stayton <bobs@sagehill.net> wrote:

    > Hi Tim,
    > Indeed, this is a bug in the namespaced version of the stylesheets.
    >
    > When the namespaced version is generated from the non-namespaced version,
    > this line:
    >
    > <xsl:when test="$content/*[1][self::html]">
    >
    > gets converted to this line:
    >
    > <xsl:when test="$content/*[1][self::d:html]">
    >
    > because it thinks html is a DocBook element name. But of course, your html
    > element is not in the DocBook namespace, so this test fails and the element
    > is passed through.
    >
    > I need to patch the conversion process to fix this. The workaround for you
    > is to copy the template named "pi.dbhtml-include" from xhtml/pi.xsl to your
    > customization layer and remove the "d:" prefix.
    >
    > Bob Stayton
    > Sagehill Enterprises
    > bobs@sagehill.net
    >
    >
    > On 7/2/2014 9:08 AM, Tim Arnold wrote:
    >
    >> hi,
    >> I'm using this type of processing instruction in my docbook 5 source:
    >>
    >> and the docs say that the wrapper inside the external doc will be
    >> removed, if I understand it correctly:
    >> http://www.sagehill.net/docbookxsl/InsertExtHtml.html
    >>
    >> However, here is a test file that does not remove the 'html' wrapper:
    >>
    >> -------- db.xml ---------
    >> <chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
    >> xml:id="new" >
    >> <info></info>
    >> <para>
    >>

    >> <info></info>
    >>

    >> </para>
    >> </chapter>
    >>
    >> ------ output.htm -------
    >>
    >>

    >>

    >>
    >>
    >>
    Output

    >>

    >>

    stuff


    >>

    >>

    >>
    >>
    >> The tags are present inside the html file resulting from either
    >> of these commands:
    >>
    >> xsltproc docbook/xsl-1.78.1/html/chunk.xsl db.xml
    >> xsltproc docbook/xsl-1.78.1/epub3/chunk.xsl db.xml
    >>
    >> Maybe I'm missing a parameter or this is a bug?
    >> thanks,
    >> --Tim
    >>
    >>