Edit online

The default numbering system is to only number the chapters in the TOC and in the content (shallow numbering).
Note: For a plain DITA map, the chapters are the <topicref> elements that are placed on the first level. For bookmaps, the chapters are the topics referenced by a <chapter> element.

Edit online

The numbering affects three parts of your publication, the table of contents, headers/footers, and chapter titles:

The Table of Contents

The table of contents is a tree of <topicref> elements.

<map xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" ...>
  <oxy:front-page xmlns:oxy="http://www.oxygenxml.com/extensions/author" 
        class=" front-page/front-page ">
        ...
  </oxy:front-page>
  <opentopic:map xmlns:opentopic="http://www.idiominc.com/opentopic" class=" toc/toc ">
    <title class="- topic/title ">Publication Title</title>

    <topicref is-chapter="true" class="- map/topicref " ... >
      <topicmeta class="- map/topicmeta " ... >
        <navtitle href="#unique_1" class="- topic/navtitle ">Overview</navtitle>
            ...
      </topicmeta>
      <topicref class="- map/topicref " ...>
        <topicmeta class="- map/topicmeta " data-topic-id="dcpp_resources">
          <navtitle href="#unique_2" class="- topic/navtitle ">Resources</navtitle>
            ...
        </topicmeta>
      </topicref>
        ...
  </opentopic:map>
...
</map>
Note: The <opentopic:map> element contains the effective table of contents structure.
Note: The TOC items are the elements with the class: - map/topicref.
Note: The ones identified as chapters have the @is-chapter attribute set.

For the DITA Map PDF - based on HTML5 & CSS transformation type, the merged map is further processed resulting in a collection of HTML5 <div> elements. These elements preserve the original DITA @class attribute values and add a new value derived from the DITA element name.

<div class="- map/map map" ...>
  <div 
        class=" front-page/front-page front-page">
        ...
  </div>
  <div class=" toc/toc toc">
    <div class="- topic/title title">Publication Title</title>

    <div is-chapter="true" class="- map/topicref topicref" ... >
      <div class="- map/topicmeta topicmeta" ... >
        <div href="#unique_1" class="- topic/navtitle navtitle">Overview</div>
            ...
      </div>
      <div class="- map/topicref " ...>
        <div class="- map/topicmeta " data-topic-id="dcpp_resources">
          <div href="#unique_2" class="- topic/navtitle ">Resources</div>
            ...
        </div>
      </div>
        ...
  </div>
...
</div>

The Header and Footers

These are based on string sets generated for the titles. The complete set of strings is defined in: [INSTALLATION_DIR]/css/print/p-pages-and-headers.css.

The CSS rules that build the string sets are matching the map title from the front page and the titles from the content.
<oxy:front-page xmlns:oxy="http://www.oxygenxml.com/extensions/author">
        <oxy:front-page-title>
            <title class="- topic/title ">Publication Title</title>
        </oxy:front-page-title>
</oxy:front-page>
For the DITA Map PDF - based on HTML5 & CSS transformations:
<div class=" front-page/front-page front-page">
        <div class=" front-page-title/front-page-title front-page-title">
            <div class="- topic/title title ">Publication Title</div>
        </div>
</div>
The main content is organized as follows:
<map xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" ...>
    ...
    <opentopic:map xmlns:opentopic="http://www.idiominc.com/opentopic">
      ...
    </opentopic:map>

    <topic is-chapter="true" oid="dcpp_overview">
        <title class="- topic/title ">Overview</title>
        <body class="- topic/body ">
            ...
        </body>
        <topic class="- topic/topic " id="unique_2" oid="dcpp_resources">
            <title class="- topic/title ">Resources</title>
            ...
        </topic>
        <topic class="- topic/topic " id="unique_2" oid="dcpp_parameters">
            <title class="- topic/title ">Parameters</title>
            ...
        </topic>
    </topic>
For the DITA Map PDF - based on HTML5 & CSS transformations:
<div class=" map/map map" ...>
    ...
   <div class=" toc/toc toc">
      ...
    </div>

    <div is-chapter="true" oid="dcpp_overview" class="- topic/topic topic">
        <div class="- topic/title title">Overview</title>
        <div class="- topic/body body">
            ...
        </div>
        <div class="- topic/topic topic" id="unique_2" oid="dcpp_resources">
            <div class="- topic/title title">Resources</div>
            ...
        </div>
        <div class="- topic/topic topic" id="unique_2" oid="dcpp_parameters">
            <div class="- topic/title title">Parameters</div>
            ...
        </div>
    </div>
Note: The topic content comes after the <opentopic:map> element.
Note: The child topics are the elements that have the class - topic/topic included in the parents.
Note: The ones identified as chapters have the @is-chapter attribute set.

The Titles of Chapters

The titles from the content are children of the topics:
<topic class="- topic/topic " id="unique_2" oid="dcpp_parameters">
        <title class="- topic/title ">Parameters</title>
            ...
</topic>
For the DITA Map PDF - based on HTML5 & CSS transformations:
<div class="- topic/topic topic" id="unique_2" oid="dcpp_parameters">
        <div class="- topic/title title ">Parameters</div>
            ...
</div>
Note: The title elements have the class: - topic/title. The actual element name can be different.

Edit online

There is a file located in [PLUGIN_DIR]/css/print/p-numbering-shallow. The following examples are from this file.

Note: This is listed solely for illustration purposes, as the plugin might use something different.

The counters should be reset on the root element. This is the element that has the class map/map. Note that bookmaps derive from maps and the following selector will also match them:

*[class ~= "map/map"] {
    counter-reset: page 1
                     toc-chapter 0
                     chapter 0
                     figcount 0
                     tablecount 0;
}

Table of Contents

There is only one counter for the chapters, named toc-chapter. This is reset on the book parts (for bookmaps) and is incremented on each chapter that is not a part.
Note: The parts are also marked as chapters.
*[class ~= "map/topicref"][is-chapter]:not([is-part]) {
    counter-increment:toc-chapter;
}
*[class ~= "map/topicref"][is-part] {
   counter-reset:toc-chapter !important;
   counter-increment:toc-part;
} 
 
/* All other topicrefs that follow a part should not have a number (i.e appendices)  */
*[class ~= "map/topicref"][is-part] ~ *[class ~= "map/topicref"]:not([is-part]) > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"]:before{
   content: none !important;
   counter-increment:none;
}
To display the numbers in the TOC, a :before pseudo element is used on the navigation titles from the <topicref> elements:
*[class ~= "map/topicref"][is-part] > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"]:before{
   content:"Part " counter(toc-part, upper-roman) ". " !important;
   color:inherit;
}    
*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"]:before{
    content:"Chapter " counter(toc-chapter) ". " !important;
    color:inherit;
}

The Titles of Chapters in the Main Content

The part and chapter counters are incremented on the elements that have the class topic/topic:
*[class ~= "topic/topic"][is-part]{
    counter-increment:part;
    counter-reset:chapter;
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]){
    counter-increment:chapter;
}
Except for <frontmatter>, <backmatter>, and other topics following the last book part (for bookmaps).
*[class ~= "bookmap/frontmatter"],
*[class ~= "bookmap/frontmatter"] *[class ~= "topic/topic"],
*[class ~= "bookmap/backmatter"],
*[class ~= "bookmap/backmatter"] *[class ~= "topic/topic"],
*[class ~= "topic/topic"][is-part] ~ *[class ~= "topic/topic"]:not([is-part]) {
   counter-increment:none !important;
   counter-reset: chapter part;
}
These counters are used in the content, before the titles:
*[class ~= "topic/topic"][is-part] > *[class ~= "topic/title"]:before {
    content: "Part " counter(part, upper-roman) ". ";
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/title"]:before {
    content: "Chapter " counter(chapter) ". ";
}
Except for <frontmatter>, <backmatter>, and other topics following the last book part (for bookmaps).
*[class ~= "bookmap/frontmatter"] > *[class ~= "topic/title"]:before,
*[class ~= "bookmap/frontmatter"] *[class ~= "topic/topic"] > *[class ~= "topic/title"]:before,
*[class ~= "bookmap/backmatter"] > *[class ~= "topic/title"]:before,
*[class ~= "bookmap/backmatter"] *[class ~= "topic/topic"] > *[class ~= "topic/title"]:before,
*[class ~= "topic/topic"][is-part] ~ *[class ~= "topic/topic"]:not([is-part]) > *[class ~= "topic/title"]:before,
*[class ~= "topic/topic"][is-part] ~ *[class ~= "topic/topic"]:not([is-part]) *[class ~= "topic/topic"] > *[class ~= "topic/title"]:before{
    content:none !important;
}

Headers

Define the string-sets used in the header, using the part and chapter counters:
*[class ~= "topic/topic"][is-part] > *[class ~= "topic/title"] {
    string-set: parttitle " | " counter(part, upper-roman) " - " content(), chaptertitle  ""; /* Avoid propagating a past chapter title on a new part */
}
*[class ~= "topic/topic"][is-chapter]:not([is-part]) > *[class ~= "topic/title"] {
    string-set: chaptertitle " | " counter(chapter) " - " content();
}
Except for front matter, backmatter and other topics following the last book part (for bookmaps).
*[class ~= "bookmap/frontmatter"] > *[class ~= "topic/title"],
*[class ~= "bookmap/frontmatter"] *[class ~= "topic/topic"] > *[class ~= "topic/title"],
*[class ~= "bookmap/backmatter"] > *[class ~= "topic/title"],
*[class ~= "bookmap/backmatter"] *[class ~= "topic/topic"] > *[class ~= "topic/title"],
*[class ~= "topic/topic"][is-part] ~ *[class ~= "topic/topic"]:not([is-part]) > *[class ~= "topic/title"],
*[class ~= "topic/topic"][is-part] ~ *[class ~= "topic/topic"]:not([is-part]) *[class ~= "topic/topic"] > *[class ~= "topic/title"]{
   string-set: parttitle "", chaptertitle "";
}