Hi (do I say Hussein or Shafie?)!

THANK YOU SO MUCH!!!!  I wasn't thrilled with the "easy" solution so I went to 
the next step and it wasn't that advanced after all.  The perfect solution is 
as follows:

In collapsible.imp, change:

part > title:first-child:before { 
    content: collapser() " Part " counter(n-, upper-roman) ": "; 
}

chapter > title:first-child:before { 
    content: collapser() " Chapter " label(xpath, "1 + 
count(../preceding::chapter)") ": " ; 
}

sect1 > title:first-child:before { 
    content: collapser() " " label(xpath, "1 + count(../preceding::chapter)") 
"." counter(n-) " "; 
}

sect2 > title:first-child:before { 
    content: collapser() " " label(xpath, "1 + count(../preceding::chapter)") 
"." counter(nn-) " "; 
}

... (for sect3, sect4, sect5 and the section/section... ones as well)

As you noted, using the label in place of the counter expression replaces the 
generated chapter/section numbers, and the XPATH expression lets you just count 
the preceding chapters regardless of what "parts" they are in.  So my text 
comes out:

PART I - First Part
Chapter 1. First Chapter
1.1 First section
1.1.1 A subsection
1.1.2 Another subsection
1.2 Second section
Chapter 2. Second Chapter
2.1 First section
2.2 Second section
PART II - Second Part
Chapter 3. Third Chapter (first in Part 2)
3.1 First section
3.2 Second section
Chapter 4. Fourth Chapter
4.1 First section
4.2 Second section

What a fantastically versatile tool!  

I even figured out how to use the "drop-in" attribute editing fields in the 
WYSINR view so that I could put a text field for docbook "ids" above each 
Chapter and Section.  We are using IDs extensively to manage our chapters and 
sections and cross-referencing and this makes it easy to put IDs into the tags 
without having to switch back and forth to the tag view and its attribute panel.

Your help has been invaluable.  I am pretty certain I am going to recommend to 
my boss that we use your product extensively, and we should be buying at least 
some licenses for our writers.  

Thanks again so much!!!

Jon

>  -------Original Message-------
>  From: Hussein Shafie <hussein at xmlmind.com>
>  Subject: Re: [XXE] About customizing the Docbook WYSIWYG view in XML Mind
>  Sent: 27 Sep '06 14:49
>  
>  jon at stagelightproductions.org wrote:
>  >
>  > I got the style of chapter/sect numbering I wanted by adding another n to 
> the front of each group in collapsible.imp which then included the Chapter 
> number in each section title which is GREAT (exactly what I wanted to do)
>  >
>  > However, I still can't seem to get the chapters to NOT reset to 1 within 
> each new part.??I tried several things (the use of the n and the - still 
> aren't clear to me) in the Chapter definition in collapsible.imp:
>  >
>  > /* I added a dash BEFORE the first n but this didn't do anything */
>  > chapter > title:first-child:before {??content: collapser() " Chapter " 
> counter(-n-, decimal) ": "; }
>  >
>  > /* I removed the dash after the n but this caused the chapter number to 
> NOT increment at all */
>  > chapter > title:first-child:before {??content: collapser() " Chapter " 
> counter(n, decimal) ": "; }
>  >
>  > So the - seems to trigger the incrementing within the parent, but since 
> the part is always the parent of chapter, that means I can't make the chapter 
> numbers incremener 1,2,3,4,5,6... even if Part I surrounds 1,2,3 and Part II 
> surrounds 4,5,6...
>  >
>  
>  Please find attached to this email a replacement for
>  XXE_install_dir/addon/config/docbook/css/docbook1.imp
>  
>  This will give you something looking like attached screenshot. That's
>  the best we can do without any special effort.
>  
>  Now an advanced alternative to using counter() is to use label(). See
>  http://www.xmlmind.com/xmleditor/_distrib/doc/csssupport/label.html.
>  
>  It is also possible to code CSS style sheet extensions in Java[tm]. See
>  http://www.xmlmind.com/xmleditor/_distrib/doc/dev/styleext.html.
>  
>  
>  
>  
>  
>  /*
>  * Copyright (c) 2003-2004 Pixware.
>  *
>  * This file is part of the XMLmind XML Editor project.
>  * For conditions of distribution and use, see the accompanying legal.txt 
> file.
>  *
>  * Styles for making sections and blocks with titles collapsible.
>  */
>  
>  set,
>  book,
>  part,
>  reference,
>  chapter,
>  preface,
>  article,
>  sect1,
>  sect2,
>  sect3,
>  sect4,
>  section,
>  appendix,
>  figure,
>  example,
>  table {
>  ????collapsible: yes;
>  ????not-collapsible-head: 1; /* title or metainfo */
>  }
>  
>  figure {
>  ????collapsed-content: url(icons/figure.gif);
>  ????collapsed-content-align: center;
>  }
>  
>  example {
>  ????collapsed-content: url(icons/para.gif);
>  ????collapsed-content-align: center;
>  }
>  
>  table {
>  ????collapsed-content: url(icons/table.gif);
>  ????collapsed-content-align: center;
>  }
>  
>  set > title:first-child:before,
>  book > title:first-child:before,
>  reference > title:first-child:before,
>  preface > title:first-child:before,
>  article > title:first-child:before,
>  figure > title:before,
>  example > title:before,
>  table > title:before {
>  ????content: collapser() " ";
>  }
>  
>  part > title:first-child:before {
>  ????content: collapser() " Part " counter(n-, upper-roman) ": ";
>  }
>  
>  chapter > title:first-child:before {
>  ????content: collapser() " Chapter " counter(nn-, decimal) ": ";
>  }
>  
>  sect1 > title:first-child:before {
>  ????content: collapser() " " counter(nnn-) " ";
>  }
>  
>  sect2 > title:first-child:before {
>  ????content: collapser() " " counter(nnnn-) " ";
>  }
>  
>  sect3 > title:first-child:before {
>  ????content: collapser() " " counter(nnnnn-) " ";
>  }
>  
>  sect4 > title:first-child:before {
>  ????content: collapser() " " counter(nnnnnn-) " ";
>  }
>  
>  section > title:first-child:before {
>  ????content: collapser() " " counter(nnn-) " ";
>  }
>  
>  section section > title:first-child:before {
>  ????content: collapser() " " counter(nnnn-) " ";
>  }
>  
>  section section section > title:first-child:before {
>  ????content: collapser() " " counter(nnnnn-) " ";
>  }
>  
>  section section section section > title:first-child:before {
>  ????content: collapser() " " counter(nnnnnn-) " ";
>  }
>  
>  section section section * section > title:first-child:before {
>  ????content: "";
>  }
>  ??????
>  appendix > title:first-child:before {
>  ????content: collapser() " Appendix " counter(n-, upper-alpha) ": ";
>  }
>  
>  appendixinfo:first-child,
>  articleinfo:first-child,
>  bookinfo:first-child,
>  chapterinfo:first-child,
>  partinfo:first-child,
>  prefaceinfo:first-child,
>  referenceinfo:first-child,
>  sect1info:first-child,
>  sect2info:first-child,
>  sect3info:first-child,
>  sect4info:first-child,
>  sectioninfo:first-child,
>  setinfo:first-child {
>  ????margin-left: 20px;
>  }
>  
>  appendixinfo:first-child:before,
>  articleinfo:first-child:before,
>  bookinfo:first-child:before,
>  chapterinfo:first-child:before,
>  partinfo:first-child:before,
>  prefaceinfo:first-child:before,
>  referenceinfo:first-child:before,
>  sect1info:first-child:before,
>  sect2info:first-child:before,
>  sect3info:first-child:before,
>  sect4info:first-child:before,
>  sectioninfo:first-child:before,
>  setinfo:first-child:before {
>  ????content: collapser();
>  ????display: marker;
>  }
>  

Reply via email to