--> I'll suggest not to specify the collapser as generated content for
the "title" child element, but rather to specify the collapser as
generated content for the "variablelist" element itself:
---
variablelist {
collapsible: yes;
/*not-collapsible-head: 1;*/
collapsed-content: "variablelist";
collapsed: yes;
/*margin-left: 4ex;*/
margin-left: 6ex; /*Larger than original value*/
}
variablelist:before {
display: marker; /*with adaptations, display:block would work too*/
content: collapser();
}
/* Of course, remove the "variablelist > title:before" rule */
---
--> It is also possible to mix both approaches (trickier):
---
variablelist {
collapsible: yes;
/*not-collapsible-head: 1;*/
collapsed-content: "variablelist";
collapsed: yes;
/*margin-left: 4ex;*/
margin-left: 6ex; /*Larger than original value*/
}
variablelist:before {
display: marker;
content: collapser();
}
variablelist > title:before {
content: collapser() " [" label(xpath, "../@xml:id") "] ";
}
variablelist:contains-element(title) {
not-collapsible-head: 1;
collapsed-content: "";
margin-left: 4ex; /*Restore original value*/
}
variablelist:contains-element(title):before {
content: "";
}
---
See
http://www.xmlmind.com/xmleditor/_distrib/doc/csssupport/containing_child.html
---
PS: I've not tested all this but I'm sure that there is no bug here.
Just the usual pitfall: playing with the computed specificities of the
CSS rules may be tricky
(http://www.w3.org/TR/REC-CSS2/cascade.html#specificity).
Fabian Mandelbaum wrote:
>
> We've stumbled upon a rendering issue on
> collapsed-by-default-and-no-title variablelists: only the first list
> entry is rendered, not the rest of the entries.
>
> The test document and CSS, together with the resulting output is attached.
>
> Maybe this is due to the fact that when the collapsible element
> (variablelist in this case) doesn't have a title, it's not possible to
> render it properly? (where to put the collapser?)
>
> How do you suggest we solve this issue?
>
> ------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
> @import url(xxe-config:docbook/css/docbook.css);
>
> variablelist {
> collapsible: yes;
> not-collapsible-head: 1;
> collapsed: yes;
> }
>
> variablelist > title:before {
> content: collapser() " [" label(xpath, "../@xml:id") "] ";
> }
>
>
> ------------------------------------------------------------------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-stylesheet type="text/css" href="varitest.css"?>
> <section>
> <title>Test Section</title>
>
> <para>The aim of this test document is to verify the problem of
> varilist rendering. Only the first entry of a collapsable varilist is
> displayed if the varilist starts collapsed and has no title.</para>
>
> <section>
> <title>Varilist with title</title>
>
> <para>Here we have a varilist with title, collapsed by default, with
> 3 entries:</para>
>
> <variablelist>
> <title>A varilist title</title>
>
> <varlistentry>
> <term>Entry 1</term>
>
> <listitem>
> <para>Bla, bla, bla</para>
> </listitem>
> </varlistentry>
>
> <varlistentry>
> <term>Entry 2</term>
>
> <listitem>
> <para>Bli, bli, bli</para>
> </listitem>
> </varlistentry>
>
> <varlistentry>
> <term>Entry 3</term>
>
> <listitem>
> <para>Blo, blo, blo</para>
> </listitem>
> </varlistentry>
> </variablelist>
> </section>
>
> <section>
> <title>Varilist without title</title>
>
> <para>Here we have a varilist without title, collapsed by default,
> with 3 entries.</para>
>
> <variablelist>
> <varlistentry>
> <term>Entry 1</term>
>
> <listitem>
> <para>Bla, bla, bla</para>
> </listitem>
> </varlistentry>
>
> <varlistentry>
> <term>Entry 2</term>
>
> <listitem>
> <para>Bli, bli, bli</para>
> </listitem>
> </varlistentry>
>
> <varlistentry>
> <term>Entry 3</term>
>
> <listitem>
> <para>Blo, blo, blo</para>
> </listitem>
> </varlistentry>
> </variablelist>
> </section>
> </section>
>