[xsl] "Merging" space-before

Subject: [xsl] "Merging" space-before
From: Fredrik Bengtsson <Fredrik.Bengtsson@xxxxxxxxxxxx>
Date: Fri, 29 Apr 2011 15:34:14 +0000
I've been trying to wrap my head around "4.3 Spaces and Conditionality" in the
XSL spec, but I'm a bit confused.

What I'd like to have is a block A which may or may not have a nested block B
inside it (actually a title inside a chapter wrapper). A itself has a
space-before of 6pt, and with no B inside, that's what will separate stuff
before A from other things inside A. B has a space-before of 18pt, and when it
is present I want the total space between stuff before A and B itself to be
18pt, not 18+6pt. That is, I want their spaces to overlap such that the
greater one wins. How do I do that?

I could make a rule that matches on the two cases separately of course by
setting the space-before to different values in each case, but I'd like it if
there were a prettier way.

Regards,
/Fredrik

Current Thread