/*
 * Copyright (c) 2006-2008 Pixware. 
 *
 * This file is part of the XMLmind XML Editor project.
 * For conditions of distribution and use, see the accompanying legal.txt file.
 *
 * Displays the structure (a little more than a TOC) of a DocBook document.
 */

@namespace "http://docbook.org/ns/docbook";
@namespace db5 "http://docbook.org/ns/docbook";

*, 
*:comment,
*:processing-instruction {
    display: none;
}

title {
    display: block;
}

title > * {
    display: inline;
}

setindex,
dedication,
toc,
lot,
glossary,
bibliography,
index,
colophon,
partintro,
tocchap,
info {
    display: block; 
    content: element-name();
    font-size: small;
    color: gray;
}

set,
book,
part,
reference,
refentry,
preface,
chapter,
article,
appendix,
section,
sect1,
sect2,
sect3,
sect4,
sect5,
info:contains-element(title) {
    display: block;
    margin-left: 9ex;
}

info:contains-element(title) {
    content: "";
    font-size: inherit;
    color: inherit;
}

set:before,
book:before,
part:before,
reference:before,
refentry:before,
preface:before,
chapter:before,
article:before,
appendix:before,
section:before,
sect1:before,
sect2:before,
sect3:before,
sect4:before,
sect5:before,
info:contains-element(title):before {
    display: marker;
    marker-offset: fill;
    content: element-name();
    font-size: small;
    color: gray;
}

part > info > title:before,
part > title:before { 
    content: simple-counter(n-, upper-roman) " "; 
}

chapter > info > title:before,
chapter > title:before { 
    content: simple-counter(n-, decimal) " "; 
}

appendix > info > title:before,
appendix > title:before { 
    content: simple-counter(n-, upper-alpha) " "; 
}

refentry {
    content: xpath("join(.//db5:refname, ', ')");
    color: gray;
}

section > info > title:before,
sect1 > info > title:before,
section > title:before,
sect1 > title:before {
    content: simple-counter(n-) " "; 
}

section section > info > title:before,
sect2 > info > title:before,
section section > title:before,
sect2 > title:before { 
    content: simple-counter(nn-) " "; 
}

section section section > info > title:before,
sect3 > info > title:before,
section section section > title:before,
sect3 > title:before {
    content: simple-counter(nnn-) " "; 
}

section section section section > info > title:before,
sect4 > title:before,
section section section section > info > title:before,
sect4 > title:before { 
    content: simple-counter(nnnn-) " "; 
}

section section section section section > info > title:before,
sect5 > info > title:before,
section section section section section > title:before,
sect5 > title:before { 
    content: simple-counter(nnnnn-) " "; 
}

section section section section * section > info > title:before,
section section section section * section > title:before { 
    content: ""; 
}
