AH Formatter / XSL Formatter
Q&A



XSLT/XSL-FO/SVG/MathML Conformance

XSL-FO

Top
Basic, General
About AH Formatter
About XSL Formatter
Operation
Programming
XSLT/XSL-FO/SVG/MathML Conformance
XSLT/XSL-FO/MathML Technics
Index
Q.  I specified margin-left="0pt" for fo:block enclosed with border. However, its result is not the same as fo:block for which margin-left is not specified. Why? [No.2005082601]
A. 

In the W3C Recommendation for XSL-FO, it is as follows:

7.10.3 "margin-left"

...

XSL modifications to the CSS definition:
Margin-left is provided for compatibility with CSS.
Details on the mapping of CSS "margin" properties for XSL are given in [5 Property Refinement / Resolution].

And, it is written in 5.3.2 Margin, Space, and Indent Properties as follows.

5.3.2 Margin, Space, and Indent Properties

...

start-indent = margin-corresponding + padding-corresponding + border-corresponding-width
end-indent = margin-corresponding + padding-corresponding + border-corresponding-width

...

start-indent = inherited_value_of(start-indent) + margin-corresponding + padding-corresponding + border-corresponding-width
end-indent = inherited_value_of(end-indent) + margin-corresponding + padding-corresponding + border-corresponding-width

...

margin-corresponding = start-indent - inherited_value_of(start-indent) - padding-corresponding - border-corresponding-width
margin-corresponding = end-indent - inherited_value_of(end-indent) - padding-corresponding - border-corresponding-width

For instance, when margin is specified,

<fo:block margin-left="0" margin-right="0" border="5mm double black">

You will obtain the following calculation results.

start-indent = inherited_value_of(start-indent) + margin-corresponding + padding-corresponding + border-corresponding-width 
             = 0 + 0 + 0 + 5mm = 5mm

end-indent = inherited_value_of(end-indent) + margin-corresponding + padding-corresponding + border-corresponding-width 
           = 0 + 0 + 0 + 5mm = 5mm

If margin is not specified, it is the following results.

<fo:block border="5mm double black">
margin-corresponding = start-indent - inherited_value_of(start-indent) - padding-corresponding - border-corresponding-width 

margin-corresponding = end-indent - inherited_value_of(end-indent) - padding-corresponding - border-corresponding-width

Therefore, the result is different because of the presence of margin.

margin-left = 0 - 0 - 0 - 5mm = -5mm
margin-right = 0 - 0 - 0 - 5mm = -5mm

Copyright © 1999-2011 Antenna House, Inc. All rights reserved.
Antenna House is a trademark of Antenna House, Inc.