docbook-apps

  • 1.  section "label" attribute not producing label

    Posted 09-25-2019 18:41
    Hi,

    I'm entirely new to DocBook and am trying to use it in Oxygen's XML Editor (v. 21). I'm trying to convert a client's native XML to DocBook for use.

    I have a document with <sect1> as a root element and subsections and the @label attribute does not work:


    1. In Oxygen Author mode section labels are prefixed with the label of the component that contains them (I want to turn that off), plus the actual @label value is ignored (autonumbering takes over), e.g., <sect1 label="Chapter 6"> appears in Oxygen as "Section 1:"
    2. In PDF the @label value is simply ignored.

    Any help is appreciated. Thanks.

    Regards,
    Brendan Martin



  • 2.  Re: [docbook-apps] section "label" attribute not producing label

    Posted 09-26-2019 00:46
    What are you using for your transformation/stylesheet?
    Docbook parameters allow you to turn the labels on/off. Via Oxygenxml it is
    quite easy once you know where to look under the parameters.
    You might want to switch to book as your root and use "xi:include" if you
    want to work with separate files.
    With tomes this is a real advantage to work with portions of the text. I am
    presently working on a graphic heavy text that is now separated into 32
    portions.
    See:
    http://www.sagehill.net/docbookxsl/ModularDoc.html#UsingXinclude
    Trust this helps - Paul

    On Wed, Sep 25, 2019 at 4:11 PM Brendan Martin <
    bmartin@orbistechnologies.com> wrote:

    > Hi,
    >
    >
    >
    > I’m entirely new to DocBook and am trying to use it in Oxygen’s XML Editor
    > (v. 21). I’m trying to convert a client’s native XML to DocBook for use.
    >
    >
    >
    > I have a document with <sect1> as a root element and subsections and the
    > @label attribute does not work:
    >
    >
    >
    > 1. In Oxygen Author mode section labels are prefixed with the label of
    > the component that contains them (I want to turn that off), plus the actual
    > @label value is ignored (autonumbering takes over), e.g., <sect1
    > label=”Chapter 6”> appears in Oxygen as “Section 1:”
    > 2. In PDF the @label value is simply ignored.
    >
    >
    >
    > Any help is appreciated. Thanks.
    >
    >
    >
    > Regards,
    >
    > Brendan Martin
    >



  • 3.  Re: [docbook-apps] section "label" attribute not producing label

    Posted 09-26-2019 05:36
    Dear Brendan,

    A couple of remarks:
    Oxygen XML Editor's visual editing mode is based on CSS, you can right
    click in the Author visual editing mode and choose to use the "Inspect
    Styles" action to see what CSS styles are used to display the current
    element.
    Although we designed our editing CSS to be similar to how the published
    output looks the publishing part is totally uncoupled from the CSS used
    for editing so it may happen that you see things in a certain way when
    editing but differently when publishing. For example we did not add
    special selectors in our editing CSS to look at the @label value for
    each section. This can be done of course but it seems that also the
    publishing kind of ignores these @label attributes on various elements.

    Coming back to your problem, in my opinion it's more flexible to use the
    DocBook
    element instead of using <sectX> element. This is more
    flexible because it allows you to copy sections from one place to
    another without needing to rename the element name for example.

    For the DocBook PDF output there is an XSLT stylesheet created by the
    DocBook XSLT project:

    OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/fo/sections.xsl

    which matches various sections like:

    > <xsl:template match="d:section">

    or:

    > <xsl:template match="d:sect1">

    which match various DocBook section elements and produce the
    corresponding XSL-FO content which later is converted to PDF using the
    Apache FOP processor bundled with Oxygen.
    Right now I do not see any special XSLT code in these templates which
    looks for the @label attribute, no matter what parameters would be set.

    Regards,
    Radu

    Radu Coravu
    <oXygen/> XML Editor
    http://www.oxygenxml.com

    On 9/25/2019 9:41 PM, Brendan Martin wrote:
    > Hi,
    >
    >
    >
    > I’m entirely new to DocBook and am trying to use it in Oxygen’s XML
    > Editor (v. 21). I’m trying to convert a client’s native XML to DocBook
    > for use.
    >
    >
    >
    > I have a document with <sect1> as a root element and subsections and the
    > @label attribute does not work:
    >
    >
    >
    > 1. In Oxygen Author mode section labels are prefixed with the label of
    > the component that contains them (I want to turn that off), plus the
    > actual @label value is ignored (autonumbering takes over), e.g.,
    > <sect1 label=”Chapter 6”> appears in Oxygen as “Section 1:”
    > 2. In PDF the @label value is simply ignored.
    >
    >
    >
    > Any help is appreciated. Thanks.
    >
    >
    >
    > Regards,
    >
    > Brendan Martin
    >





  • 4.  RE: [docbook-apps] section "label" attribute not producing label

    Posted 09-26-2019 12:08
    Radu,

    FYI, I figured out how to override the css styling in the near term, but I think in the long run your suggestions about
    are going to be useful.

    I'm just doing a Proof of Concept for a potential client for the moment.

    Regards,
    Brendan




  • 5.  Re: [docbook-apps] section "label" attribute not producing label

    Posted 09-26-2019 22:02
    If you are just getting started with DocBook, I would recommend my free
    online book "DocBook XSL: The Complete Guide".  In this section of the book:

    http://www.sagehill.net/docbookxsl/SectionNumbering.html

    it says that "To turn on basic section numbering, set the
    /|section.autolabel|/ parameter to 1".  Stylesheet parameters can be set
    on the command line or in an XSL customization layer as described
    elsewhere in the book.

    Once section numbering is turned on, the @label value on a sect1 element
    will override the default number.

    Bob Stayton
    bobs@sagehill.net

    On 9/25/2019 11:41 AM, Brendan Martin wrote:
    >
    > Hi,
    >
    > I’m entirely new to DocBook and am trying to use it in Oxygen’s XML
    > Editor (v. 21). I’m trying to convert a client’s native XML to DocBook
    > for use.
    >
    > I have a document with <sect1> as a root element and subsections and
    > the @label attribute does not work:
    >
    > 1. In Oxygen Author mode section labels are prefixed with the label
    > of the component that contains them (I want to turn that off),
    > plus the actual @label value is ignored (autonumbering takes
    > over), e.g., <sect1 label=”Chapter 6”> appears in Oxygen as
    > “Section 1:”
    > 2. In PDF the @label value is simply ignored.
    >
    > Any help is appreciated. Thanks.
    >
    > Regards,
    >
    > Brendan Martin
    >