Loading ...
Sorry, an error occurred while loading the content.
 

Re: [dita-users] info on numbered headings for topics and sections

Expand Messages
  • Erlend Leganger
    ... After playing with this for a while, I probably found another small bug in addition to the fact that there is no numbering for each - the
    Message 1 of 11 , Oct 1, 2011
      On 30 September 2011 20:36, Erlend Leganger <erlend.leganger@...> wrote:
      Being a noob on XSLT, can you point at which parts of the code to change to remove section numbering?

      After playing with this for a while, I probably found another small bug in addition to the fact that there is no numbering for each <section> - the <section>s do show up in the TOC, but without numbers, no dotted lines and no page numbers.

      However, after looking over our slowly growing DITA repo, I see that we use <section> in very few places, and when we do, it is probably for the wrong reasons (the classic case is probably the writer who came to me and complained that it wasn't possible to nest sections...). The fix for us is probably to avoid <section> altogether; it doesn't take too much effort in our case, having a fairly small DITA repo. I guess this will be in line with what has been said about sections above, which also is supported by Tony Self in the DITA Style Guide: "In nearly all cases, separate, simple topics should be preferred to sections".

      With <section>s out of the way, Nancy's code works like a charm, it blends easily into the many customizations we already have for PDFs. This should just become a part of the DOT, if someone has the time and skills to include it.

      - Erlend
    • nlpharrison
      Getting numbers, leaders, etc. to show up in the TOC for sections requires setting up new attribute sets for the section TOC elements; that kind of
      Message 2 of 11 , Oct 1, 2011
        Getting numbers, leaders, etc. to show up in the TOC for sections requires setting up new attribute sets for the section TOC elements; that kind of customization goes in the common-attrs.xsl file, not the custom.xsl file.

        - nancy



        --- In dita-users@yahoogroups.com, Erlend Leganger <eleganger@...> wrote:
        >
        > On 30 September 2011 20:36, Erlend Leganger <erlend.leganger@...>wrote:
        >
        > > Being a noob on XSLT, can you point at which parts of the code to change to
        > > remove section numbering?
        >
        >
        > After playing with this for a while, I probably found another small bug in
        > addition to the fact that there is no numbering for each <section> - the
        > <section>s do show up in the TOC, but without numbers, no dotted lines and
        > no page numbers.
        >
        > However, after looking over our slowly growing DITA repo, I see that we use
        > <section> in very few places, and when we do, it is probably for the wrong
        > reasons (the classic case is probably the writer who came to me and
        > complained that it wasn't possible to nest sections...). The fix for us is
        > probably to avoid <section> altogether; it doesn't take too much effort in
        > our case, having a fairly small DITA repo. I guess this will be in line with
        > what has been said about sections above, which also is supported by Tony
        > Self in the DITA Style Guide: "In nearly all cases, separate, simple topics
        > should be preferred to sections".
        >
        > With <section>s out of the way, Nancy's code works like a charm, it blends
        > easily into the many customizations we already have for PDFs. This should
        > just become a part of the DOT, if someone has the time and skills to include
        > it.
        >
        > - Erlend
        >
      • JoAnn Hackos
        Erlend, It is entirely possible to develop your PDF stylesheet to that sections are numbered correctly and show up in the TPC correctly. No customization of
        Message 3 of 11 , Oct 2, 2011
          Erlend,
          It is entirely possible to develop your PDF stylesheet to that sections are numbered correctly and show up in the TPC correctly. No customization of the OT is required.

          JoAnn Hackos
          Co-Chair
          DITA Adoption Technical Committee
          Joann.hackos@...
        • Erlend Leganger
          ... Here is the obvious follow-up: How? And how can this be done without customizing the DOT s demo/fo plugin? I think all modifications to the PDF output
          Message 4 of 11 , Oct 2, 2011
            On 2 October 2011 19:59, JoAnn Hackos <joann.hackos@...> wrote:
            It is entirely possible to develop your PDF stylesheet to that sections are numbered correctly and show up in the TPC correctly. No customization of the OT is required.

            Here is the obvious follow-up: How? And how can this be done without customizing the DOT's demo/fo plugin? I think all modifications to the PDF output described on this list have been made by customizing the plugin (apart from Eliot's effort to write an entirely new extension plugin, dita4publishers), so if there is a different way, I would certainly like to learn about it.

            - Erlend
          • juliov27612
            Hi Nancy, I m curious as to why you say that the new attribute sets would belong in common-attrs.xsl instead of custom.xsl? You can have anything in the
            Message 5 of 11 , Oct 2, 2011
              Hi Nancy,

              I'm curious as to why you say that the new attribute sets would belong in common-attrs.xsl instead of custom.xsl? You can have anything in the custom.xsl file but if you want to keep purity of attributes vs. processing XSL, you can also implement a second custom.xsl file in the customization/fo/attr folder and update the catalog.xml file to point to it.

              Julio J. Vazquez
              SDI Global Solutions

              --- In dita-users@yahoogroups.com, "nlpharrison" <nlpaisner84@...> wrote:
              >
              >
              >
              > Getting numbers, leaders, etc. to show up in the TOC for sections requires setting up new attribute sets for the section TOC elements; that kind of customization goes in the common-attrs.xsl file, not the custom.xsl file.
              >
              > - nancy
              >
              >
              >
              > --- In dita-users@yahoogroups.com, Erlend Leganger <eleganger@> wrote:
              > >
              > > On 30 September 2011 20:36, Erlend Leganger <erlend.leganger@>wrote:
              > >
              > > > Being a noob on XSLT, can you point at which parts of the code to change to
              > > > remove section numbering?
              > >
              > >
              > > After playing with this for a while, I probably found another small bug in
              > > addition to the fact that there is no numbering for each <section> - the
              > > <section>s do show up in the TOC, but without numbers, no dotted lines and
              > > no page numbers.
              > >
              > > However, after looking over our slowly growing DITA repo, I see that we use
              > > <section> in very few places, and when we do, it is probably for the wrong
              > > reasons (the classic case is probably the writer who came to me and
              > > complained that it wasn't possible to nest sections...). The fix for us is
              > > probably to avoid <section> altogether; it doesn't take too much effort in
              > > our case, having a fairly small DITA repo. I guess this will be in line with
              > > what has been said about sections above, which also is supported by Tony
              > > Self in the DITA Style Guide: "In nearly all cases, separate, simple topics
              > > should be preferred to sections".
              > >
              > > With <section>s out of the way, Nancy's code works like a charm, it blends
              > > easily into the many customizations we already have for PDFs. This should
              > > just become a part of the DOT, if someone has the time and skills to include
              > > it.
              > >
              > > - Erlend
              > >
              >
            • Erlend Leganger
              ... This discussion on files is probably a bit off topic, but it doesn t prevent me from chiming in as well. Here is what I have done for this: [ncd (master)]$
              Message 6 of 11 , Oct 2, 2011
                On 2 October 2011 21:50, juliov27612 <julio_v27612@...> wrote:
                I'm curious as to why you say that the new attribute sets would belong in common-attrs.xsl instead of custom.xsl? You can have anything in the custom.xsl file but if you want to keep purity of attributes vs. processing XSL, you can also implement a second custom.xsl file in the customization/fo/attr folder and update the catalog.xml file to point to it.

                This discussion on files is probably a bit off topic, but it doesn't prevent me from chiming in as well. Here is what I have done for this:

                [ncd (master)]$ ls src/custom/fop/shared/fo/xsl/topic*
                src/custom/fop/shared/fo/xsl/topic-numbering-custom.xsl

                [ncd (master)]$ cat src/custom/fop/shared/fo/xsl/custom.xsl 
                <?xml version='1.0'?>
                <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.1">
                    <xsl:import href="static-content-custom.xsl"/>
                    <xsl:import href="front-matter_1.0-custom.xsl"/>
                    <xsl:import href="tables_1.0-custom.xsl"/>
                    <xsl:import href="task-elements-custom.xsl"/>
                    <xsl:import href="topic-numbering-custom.xsl"/>
                    <xsl:import href="../layout-masters-custom.xsl"/>
                </xsl:stylesheet>

                [ncd (master)]$ ls src/custom/fop/shared/fo/attrs/topic*
                src/custom/fop/shared/fo/attrs/topic-numbering-attr-custom.xsl

                [ncd (master)]$ cat src/custom/fop/shared/fo/attrs/custom.xsl 
                <?xml version='1.0'?>
                <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    version="1.0">
                    <xsl:import href="commons-attr-custom.xsl"/>
                    <xsl:import href="basic-settings-custom.xsl"/>
                    <xsl:import href="static-content-attr-custom.xsl"/>
                    <xsl:import href="front-matter-attr-custom.xsl"/>
                    <xsl:import href="toc-attr-custom.xsl"/>
                    <xsl:import href="lists-attr-custom.xsl"/>
                    <xsl:import href="task-elements-attr-custom.xsl"/>
                    <xsl:import href="ui-domain-attr-custom.xsl"/>
                    <xsl:import href="sw-domain-attr-custom.xsl"/>
                    <xsl:import href="topic-numbering-attr-custom.xsl"/>
                </xsl:stylesheet>

                This follows the already established pattern - the real code goes into ./xsl, while the attribute definition goes into ./attrs. And I have carefully selected the file names to start with "topic-numbering", since I want to number topics, not <section/>s.

                - Erlend
              Your message has been successfully submitted and would be delivered to recipients shortly.