AH Formatter / XSL Formatter
Q&A



XSLT/XSL-FO/MathML テクニック

継承

トップ
基本・一般
AH Formatter について
XSL Formatter について
操作方法
プログラミング
XSLT/XSL-FO/SVG/MathML 仕様について
XSLT/XSL-FO/MathML テクニック
索引
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.

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