docbook-apps

  • 1.  Hard page break in DocBook 4 document with namespace-aware DocBook XSL stylesheets

    Posted 06-12-2008 16:11
    Hello,

    I want to insert a hard page break in the XSL-FO document obtained from
    a simple DocBook XML 4 document containing the processing instruction



    and transformed with the following customization layer:

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <xsl:import
    href="file:///E:/kit/Docbook/docbook-xsl-ns-1.74.0/fo/docbook.xsl"/>

    <xsl:template match="processing-instruction('hard-pagebreak')">
    <fo:block break-after='page'/>
    </xsl:template>
    </xsl:stylesheet>

    With the namespace aware version of DocBook XSL my template that matches
    on the 'hard-pagebreak' processing instruction is never fired so the
    hard page break is not inserted. With the no namespace version of
    DocBook XSL the template is fired by the xsl:apply-templates element on
    line 350 of docbook/xsl/fo/sections.xsl. This difference between the
    namespace aware and no namespace versions is in both DocBook XSL 1.73.2
    and DocBook XSL 1.74.0. Can anyone figure out why there is this
    difference between the namespace aware and no namespace versions or how
    I could fix/work around it so that I can insert a hard page break with
    the namespace aware version?

    A sample DocBook 4 document for reproducing the problem (the
    xsl:apply-templates on line 350 of sections.xsl is inside a template
    that matches on sect1 elements):


    "http://www.docbook.org/xml/4.4/docbookx.dtd">


    <sect1>

    <para>Testing hard page break</para>
    </sect1>
    <sect1>

    <para>There is some text in the first paragraph.</para>

    <sect2>

    <para>I want this this subchapter on a new page.</para>
    </sect2>
    </sect1>



    Thank you,
    Sorin

    http://www.oxygenxml.com



  • 2.  Re: [docbook-apps] Hard page break in DocBook 4 document with namespace-aware DocBook XSL stylesheets

    Posted 06-12-2008 16:27
    Hi,
    This turns out to be a deficiency in the handling of non-namespaced
    documents by the namespace stylesheets. The same thing occurs when
    processing a namespaced document with the non-namespace stylesheets.

    In order for the namespace stylesheets to handle a non-namespaced document,
    it first preprocesses the document to generate an internal copy of the
    document with the namespace added to all elements. Then the stylesheet
    processes that copy, using its templates that match elements in the
    namespace. However, the process of generating the copy currently omits
    processing instructions and comments from the copy. That's a bug. If you
    wouldn't mind, could you please file a bug report on the SourceForge site?
    Thanks.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    ----- Original Message -----
    From: "Sorin Ristache" <sorin@oxygenxml.com>
    To: <docbook-apps@lists.oasis-open.org>
    Sent: Thursday, June 12, 2008 9:10 AM
    Subject: [docbook-apps] Hard page break in DocBook 4 document with
    namespace-aware DocBook XSL stylesheets


    > Hello,
    >
    > I want to insert a hard page break in the XSL-FO document obtained from a
    > simple DocBook XML 4 document containing the processing instruction
    >
    >
    >
    > and transformed with the following customization layer:
    >
    > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    > version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format">
    > <xsl:import
    > href="file:///E:/kit/Docbook/docbook-xsl-ns-1.74.0/fo/docbook.xsl"/>
    >
    > <xsl:template match="processing-instruction('hard-pagebreak')">
    > <fo:block break-after='page'/>
    > </xsl:template>
    > </xsl:stylesheet>
    >
    > With the namespace aware version of DocBook XSL my template that matches
    > on the 'hard-pagebreak' processing instruction is never fired so the hard
    > page break is not inserted. With the no namespace version of DocBook XSL
    > the template is fired by the xsl:apply-templates element on line 350 of
    > docbook/xsl/fo/sections.xsl. This difference between the namespace aware
    > and no namespace versions is in both DocBook XSL 1.73.2 and DocBook XSL
    > 1.74.0. Can anyone figure out why there is this difference between the
    > namespace aware and no namespace versions or how I could fix/work around
    > it so that I can insert a hard page break with the namespace aware
    > version?
    >
    > A sample DocBook 4 document for reproducing the problem (the
    > xsl:apply-templates on line 350 of sections.xsl is inside a template that
    > matches on sect1 elements):
    >
    >
    > > "http://www.docbook.org/xml/4.4/docbookx.dtd">
    >

    >
    > <sect1>
    >
    > <para>Testing hard page break</para>
    > </sect1>
    > <sect1>
    >
    > <para>There is some text in the first paragraph.</para>
    >
    > <sect2>
    >
    > <para>I want this this subchapter on a new page.</para>
    > </sect2>
    > </sect1>
    >

    >
    >
    > Thank you,
    > Sorin
    >
    > http://www.oxygenxml.com
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >
    >
    >




  • 3.  Re: [docbook-apps] Hard page break in DocBook 4 document with namespace-aware DocBook XSL stylesheets

    Posted 06-13-2008 09:01
    I filed a bug report on SourceForge:

    http://sourceforge.net/tracker/index.php?func=detail&aid=1992728&group_id=21935&atid=373747


    Regards,
    Sorin

    http://www.oxygenxml.com


    Bob Stayton wrote:
    > Hi,
    > This turns out to be a deficiency in the handling of non-namespaced
    > documents by the namespace stylesheets. The same thing occurs when
    > processing a namespaced document with the non-namespace stylesheets.
    >
    > In order for the namespace stylesheets to handle a non-namespaced
    > document, it first preprocesses the document to generate an internal
    > copy of the document with the namespace added to all elements. Then the
    > stylesheet processes that copy, using its templates that match elements
    > in the namespace. However, the process of generating the copy currently
    > omits processing instructions and comments from the copy. That's a
    > bug. If you wouldn't mind, could you please file a bug report on the
    > SourceForge site? Thanks.
    >
    > Bob Stayton
    > Sagehill Enterprises
    > bobs@sagehill.net
    >
    >
    > ----- Original Message ----- From: "Sorin Ristache" <sorin@oxygenxml.com>
    > To: <docbook-apps@lists.oasis-open.org>
    > Sent: Thursday, June 12, 2008 9:10 AM
    > Subject: [docbook-apps] Hard page break in DocBook 4 document with
    > namespace-aware DocBook XSL stylesheets
    >
    >
    >> Hello,
    >>
    >> I want to insert a hard page break in the XSL-FO document obtained
    >> from a simple DocBook XML 4 document containing the processing
    >> instruction
    >>
    >>
    >>
    >> and transformed with the following customization layer:
    >>
    >> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >> version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format">
    >> <xsl:import
    >> href="file:///E:/kit/Docbook/docbook-xsl-ns-1.74.0/fo/docbook.xsl"/>
    >>
    >> <xsl:template match="processing-instruction('hard-pagebreak')">
    >> <fo:block break-after='page'/>
    >> </xsl:template>
    >> </xsl:stylesheet>
    >>
    >> With the namespace aware version of DocBook XSL my template that
    >> matches on the 'hard-pagebreak' processing instruction is never fired
    >> so the hard page break is not inserted. With the no namespace version
    >> of DocBook XSL the template is fired by the xsl:apply-templates
    >> element on line 350 of docbook/xsl/fo/sections.xsl. This difference
    >> between the namespace aware and no namespace versions is in both
    >> DocBook XSL 1.73.2 and DocBook XSL 1.74.0. Can anyone figure out why
    >> there is this difference between the namespace aware and no namespace
    >> versions or how I could fix/work around it so that I can insert a hard
    >> page break with the namespace aware version?
    >>
    >> A sample DocBook 4 document for reproducing the problem (the
    >> xsl:apply-templates on line 350 of sections.xsl is inside a template
    >> that matches on sect1 elements):
    >>
    >>
    >> >> "http://www.docbook.org/xml/4.4/docbookx.dtd">
    >>

    >>
    >> <sect1>
    >>
    >> <para>Testing hard page break</para>
    >> </sect1>
    >> <sect1>
    >>
    >> <para>There is some text in the first paragraph.</para>
    >>
    >> <sect2>
    >>
    >> <para>I want this this subchapter on a new page.</para>
    >> </sect2>
    >> </sect1>
    >>

    >>
    >>
    >> Thank you,
    >> Sorin
    >>
    >> http://www.oxygenxml.com