Q. |
fo:wrapper はどういうときに使うのですか。 継承されるプロパティを遮断する役割なんでしょうか。
[No.2002030806]
|
A. |
プロパテイの継承関係を指定するのに便利です。
例えば fo:block-container の中のたくさんの子のブロックに同じインデントを設定したいというときに
<fo:block-container>
<fo:wrapper start-indent="..." end-indent="...">
<xsl:apply-templates/>
</fo:wrapper>
</fo:block-container>
のようにします。インデントを fo:block-container に指定してしまうと、block-container 自体がインデントして、子のブロックもさらにインデントしてしまいますので注意してください。
fo:wrapperにnon-inheritableプロパティを指定して、子から from-parent() ("inherit" も同じ) で参照させるという使い方もあります。
fo:wrapper にそのプロパティの指定がない場合は、初期値が指定されているのと同じことになるので、結果として「遮断」しているように見えるかもしれません。
<fo:flow border-before-style="solid">
<fo:wrapper>
<fo:block border-before-style="inherit">
The "inherit" value is none.
<fo:flow border-before-style="solid">
<fo:wrapper border-before-style="inherit">
<fo:block border-before-style="inherit">
The "inherit" value is solid.
|