AH Formatter / XSL Formatter
Q&A



XSLT/XSL-FO/SVG/MathML 仕様について

XSL-FO

トップ
基本・一般
AH Formatter について
XSL Formatter について
操作方法
プログラミング
XSLT/XSL-FO/SVG/MathML 仕様について
XSLT/XSL-FO/MathML テクニック
索引
Q.  border で囲んだ fo:blockmargin-left="0pt" を指定した場合と指定しなかった場合で結果が異なります。 [No.2005082601]
A. 

W3CのXSL-FO仕様の勧告には以下のように書かれています。

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].

さらに、5.3.2 Margin, Space, and Indent Propertiesには以下の式があります。

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

例えば、以下のような場合、

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

上記の式に従って計算すると、

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

となります。

marginの指定がない以下のような場合は、

<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

から、

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

となり、marginが指定された場合とは異なる結果になります。


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