Charlie Jones wrote:
> 
> I am in the process of creating a security policy for a client and I am
> using DocBook as the format.  I like the way the XXE stylesheet numbers
> sections:
> 
> 1. First section
> 1.1 Sub Section
> 1.2 Sub Section
> 1.2.1 Sub-Sub Section
> 
> I am not familar with style sheets in general.  Is there is way that you can
> stick the Chapter number in front of the section numbers.  This would
> provide each section with a unique ID.  So taking the example from above.
> If this were from Chapter 5, the section numbers would like like this:
> 
> 5.1. First section
> 5.1.1 Sub Section
> 5.1.2 Sub Section
> 5.1.2.1 Sub-Sub Section
> 
> Any help would be very appreciated.  I suppose I could replace all the
> chapter tags with section tags.  But I would rather keep the form the way it
> is.

The style for the title of a sect1 is:

sect1 > title:before { 
    content: counter(n-) " "; 
}

Note that the "counter(n-)" notation is not standard. This ``XXE
restriction'' is described in
http://www.xmlmind.com/xmleditor/_distrib/docs/poweruser/ar01s06s01.html#d0e6453

To achieve what you want, change this style to:

sect1 > title:before { 
    content: counter(nn-) " "; 
}

Note the added 'n'.

In practice, if you are using docbook-collapsible.css (the default
DocBook style sheet):

[1] copy attached mycounters.incl to
<xxe_distrib_dir>/config/docbook/css,

[2] edit this docbook-collapsible.css using a text editor and add this
line at the end of this file,

---
@import "mycounters.incl";
---

[3] reload style sheet or restart XXE. It will work nicely for books and
less nicely for articles (you'll have "1.1. First section" instead of
"1. First section").

If you want something more sophisticated, such as special handling of
sections inside appendices, well, it requires more work...
-------------- next part --------------
section > title:first-child:before { 
    content: collapser() " " counter(nn-) " "; 
}

section section > title:first-child:before { 
    content: collapser() " " counter(nnn-) " "; 
}

section section section > title:first-child:before { 
    content: collapser() " " counter(nnnn-) " "; 
}

section section section section > title:first-child:before { 
    content: collapser() " " counter(nnnnn-) " "; 
}

sect1 > title:first-child:before { 
    content: collapser() " " counter(nn-) " "; 
}

sect2 > title:first-child:before { 
    content: collapser() " " counter(nnn-) " "; 
}

sect3 > title:first-child:before { 
    content: collapser() " " counter(nnnn-) " "; 
}

sect4 > title:first-child:before { 
    content: collapser() " " counter(nnnnn-) " "; 
}

Reply via email to