Luca Furini wrote:
Chris Bowditch wrote:
Here is the sample:
I have tested a simple sequence of blocks with conditional spaces and
the output seems ok; the output of the testcase space-block2.xml
seems correct too (I'm going to add checks).
Not true, space-block2.xml does not work. On the second page, there
should not be any space between the two paragraphs.
I'm no more sure I follow you ... :-)
Well I'm not being clear enough again. Sorry.
In your example the second block has a conditional space before, but it
is not the first son of a reference area (not the first in the page) so
I would expect it not to be suppressed. Should all conditional spaces be
always suppressed, regardless of their position, what whould be the
point in using them? :-)
My sample is incomplete - it should have a space-after on first block.
The purpose of discard working between two blocks that aren't first or
last in the reference area is best explained with a use-case:
Imagine a scenario where you have many different documents generated by
different stylesheets, which all share a common styleset, i.e. an
imported XSL file containing xsl:attribute-sets. The styles defined
there are used throughout the documents. Now in some documents you might
have two adjacent paragraghs that both use styles with
space-before="10pt" and after="10pt".
In the document it is desirable only to have 10pt between the paragraphs
but how this be achieved? The paragraphs need to use the styles they are
using for other reasons. This is where discard comes in handy. Add
conditionality="discard" to the two styles and then the space from one
gets dropped. The only other alternative is to re-engineer the common
styleset which can affect many other documents. So whilst this may not
seem important in a pure FO environment, the reason the XSL-FO WG added
it to the spec was a convenience for such use cases.
As per the testcase spaces-block2, I similarly think there should be a
space between the first and second block on page 2; anyway, in this case
the actual behaviour is probably wrong as the space resolution rules (if
I understand them correctly) seems to imply that it should be only 10
Yes, that's right there should be less space - not no space.