Q. | entity参照を使用して、外部のファイル(外部エンティティ)をFOに組み込もうとしたのですが、組版結果に反映されません。なぜですか。 [No.2002111502] |
---|---|
A. |
この現象はパーサにMSXMLを使用しているために発生します。 例を示して説明します。 [ファイル名:test.fo] <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE root [ <!ENTITY testseg SYSTEM "testseg.fo"> ]> <root xmlns="http://www.w3.org/1999/XSL/Format" > <layout-master-set> <simple-page-master master-name="frame"> <region-body region-name="frame-body"/> </simple-page-master> </layout-master-set> <page-sequence master-reference="frame"> <flow flow-name="frame-body"> &testseg; </flow> </page-sequence> </root> [ファイル名:testseg.fo] <block> This is a test </block> MSXML はエンティティごとに namespace の指定がないと null namespace (namespaceなし)であるとみなされます。つまり展開元(testseg.fo)の block の namespace が展開先(test.fo) の方に指定されている namespace 指定に変わるようなことはありません。したがって、次のように展開されます。 [ファイル名:test.fo(展開後)] <?xml version="1.0" encoding="utf-8"?> <root xmlns="http://www.w3.org/1999/XSL/Format" > <layout-master-set> <simple-page-master master-name="frame"> <region-body region-name="frame-body"/> </simple-page-master> </layout-master-set> <page-sequence master-reference="frame"> <flow flow-name="frame-body"> <block xmlns="">This is a test</block> </flow> </page-sequence> </root> エンティティ名「&testseg;」が「 <block xmlns="">This is a test</block>」と展開されます。「xmlns=""」は FO namespace ではないので XSL Formatter は処理をせずに無視します。これにより、組版結果に反映されないのです。
[ファイル名:testseg.fo(修正後)] <block xmlns="http://www.w3.org/1999/XSL/Format"> This is a test </block> |
Q. | 見出しと本文が別ページにならないように指定はできますか。 [No.2002011529] |
---|---|
A. |
XSL-FO仕様の「Keeps and Breaks Properties」を実装していますので、これを使って指定できます。例えば、章見出しを表示するブロックをA、章の明細行を表示するブロックをBとします。
|
Q. | 文書中の特定のページだけ向き(ポートレートとランドスケープ)を変えることは可能でしょうか。 [No.2002011545] |
---|---|
A. |
文書内で複数のページマスタを使うことが可能ですので、次のようなポートレートとランドスケープそれぞれのページマスタを作れば表示することはできます。 <fo:simple-page-master master-name="Portrait" page-width="210mm" page-height="297mm"> ... </fo:simple-page-master> <fo:simple-page-master master-name="Landscape" page-width="297mm" page-height="210mm"> ... </fo:simple-page-master> FOデータでは、「page-width="297mm" page-height="210mm" 」とA4横(landscape)が指定されているとき、これを正しく印刷するには、プリンタのプロパティで用紙サイズと向きを設定しなくてはなりません。そうしないと普通は縦(portrait)の向きに印刷されることになります。それでページの一部がはみだしてしまうことになるので正しく印刷できません。 V2.2では、Windows NT/2000 で実行したときのみ、用紙のタテとヨコを出力時に自動的に変えられるようになっています。 |
Q. | XSL Formatter で組版中に、fo:static-content 要素をすべて宣言しないうちに、fo:flow 要素を入れ込んでもエラーが発生せずに処理されてしまいます。なぜですか。 [No.2002030802] |
---|---|
A. |
エラーは発生しないようにしています。これは XSL Formatter の「アンテナハウス XSL 拡張仕様」タグをエラーにしないためです。 |
Q. | 一つのドキュメントで内容によって給紙トレイを自動的に変えることはできますか。 例えば、 (1) トレイAには、表紙となるレターヘッド用紙、 (2) トレイBには、白紙、 (3) トレイCには、請求書用の専用用紙 [No.2002032502] |
---|---|
A. |
同じサイズの紙でトレイを分けてある場合はできませんが、各トレイが全て異なる用紙サイズ別になっているのならできます。用紙サイズを変更するために"simple-page-master"をFOの中で指定してください。Formatter は異なる用紙に組版して印刷します。プリンタへの出力時に用紙サイズも指定しますのでプリンタが対応していれば、自動的にトレイが変わります。
|
Q. | XML Formatter で、2ページに渡る印刷が発生した場合、1ページ目と2ページ目に違うフォーマットを指定することは可能でしょうか。データは繋がっているので、どこから2ページ目という情報はXMLデータには存在しません。XML Formatter 側で、交互にページフォーマットを指定することはできるのでしょうか。 [No.2002032504] |
---|---|
A. |
奇数、偶数という振り分けでしたらこれは可能です。XMLではなくスタイルシート側にページシーケンスマスターを記述することで可能になります。次に簡単なサンプルを記述します。 <fo:layout-master-set> <fo:simple-page-master master-name="odd-page-master"> <fo:region-before region-name="odd-page-header"/> その他のリージョンの記述 </fo:simple-page-master> <fo:simple-page-master master-name="even-page-master"> <fo:region-before region-name="even-page-header"/> その他のリージョンの記述 </fo:simple-page-master> <fo:page-sequence-master master-name="main"> <fo:repeatable-page-master-alternatives> <fo:conditional-page-master-reference master-name="odd-page-master" odd-or-even="odd" /> <fo:conditional-page-master-reference master-name="even-page-master" odd-or-even="even" /> </fo:repeatable-page-master-alternatives> </fo:page-sequence-master> </fo:layout-master-set> <fo:page-sequence master-reference="main"> <fo:static-content flow-name="odd-page-header"> 奇数ページ・ヘッダ用のコンテンツ(右寄せ指定) </fo:static-content> <fo:static-content flow-name="even-page-header"> 偶数ページ・ヘッダ用のコンテンツ(左寄せ指定) </fo:static-content> <fo:flow> 本文コンテンツ </fo:flow> </fo:page-sequence> |
Q. | simple-page-master を2つ準備して表紙用と本文用を作りました。このとき、本文用のほうに表紙を含まないページ番号を出力するために、本文用の page-sequence で initial-page-number に"1"をセットしました。すると、表紙と本文の間に空白ページができてしまいます。なぜですか。 [No.2002061402] |
---|---|
A. |
これは「force-page-count」というプロパティが規定値では auto になっていてページを「奇数、偶数、・・・」と並べるようにしているために、空白ページを入れて調整しています。 質問の例では表紙が1ページ目ですが次も1ページ目と宣言されているため、「奇数、奇数、偶数・・・」の並びになるので、表紙と本文の間に空白ページを入れて「奇数、偶数、奇数、偶数・・・」と並ぶように調整しているのです。 これを回避する方法は、最初のページの initial-page-number に"0"を指定するか、force-page-count プロパティに"no-force"を指定します。 |
Q. |
ページレイアウトがランドスケープ とポートレートに切り替わるドキュメントを作りたい。大きな表をプリントするときに縦印刷でははみ出るので横モードで印刷したい。 縦から横に変わるようにしてみたのですが、表が1ページに収まるときは問題がないのですが、収まりきれないときが問題。改ページしないで、表がページからはみ出してしまう [No.2002070502] |
---|---|
A. |
<fo:block-container> <!-- check if the table should have the landscape style --> <xsl:if test="@orientation='Landscape'"> <xsl:attribute name="page-break-before">always</xsl:attribute> <xsl:attribute name="page-break-after">always</xsl:attribute> <xsl:attribute name="reference-orientation">90</xsl:attribute> <xsl:attribute name="height">18.5cm</xsl:attribute> <xsl:attribute name="width">24.7cm</xsl:attribute> </xsl:if> ... rest of the table stylesheet... </fo:block-container> これは、block-container を使ってその中にtableを記述しているからです。 fo:block-container のなかではページのオーバーフローが発生しても改ページはされません。 しかし、今回の要望のようにこのtableを横書きで出力したいとなると reference-orientation は fo:block には使えませんし、 別の(横書きの)ページレイアウトを用意してその page-sequence に出力するといった処理が必要になってきます。 <fo:simple-page-master master-name="Portrait" page-width="210mm" page-height="297mm"> ... </fo:simple-page-master> <fo:simple-page-master master-name="Landscape" page-width="297mm" page-height="210mm"> ... </fo:simple-page-master> |
Q. | fo:simple-page-master に reference-orientation を指定したところ、用紙方向が変わりません。なぜですか。 [No.2002110103] |
---|---|
A. |
fo:simple-page-master に reference-orientation を指定した場合、回転するのは page-reference-area の中身であり、その外側は回転しません。
詳しくは下記のイメージをご覧ください。 |
Q. | region-beforeによって、region-bodyの一部が見えなくなってしまいました。region-body と region-before/after/start/end との Z-orderの関係はどうなっているのが正しいのでしょうか。 [No.2002110809] |
---|---|
A. |
region-body と周りの region-before/after/start/end との間での Z-order の関係は XSL-FO 仕様ではとくに規定がありません。アプリケーションの実装に依存します。
XSL Formatter の実装では、region-body を描画したあと周りの region を描画しているため、周りの region のほうが Z-order が上となっていますが、将来のバージョンで変更される可能性もあります。
|
Q. | ページシーケンスマスターで、fo:conditional-page-master-reference に、それぞれpage-position="first"、page-position="rest"、page-position="any" を指定しました。しかし最終ページに page-position="rest" を指定したfo:conditional-page-master-referenceが適用されません。なぜですか。 [No.2002112902] |
---|---|
A. |
送られてきた FO は次のようになっていました。 <fo:layout-master-set> <fo:simple-page-master master-name="firstpage" page-height="210mm" page-width="297mm"> . . . </fo:simple-page-master> <fo:simple-page-master master-name="restpage" page-height="210mm" page-width="297mm"> . . . </fo:simple-page-master> <fo:simple-page-master master-name="blankpage" page-height="210mm" page-width="297mm"> . . . </fo:simple-page-master> <fo:page-sequence-master master-name="document"> <fo:repeatable-page-master-alternatives> <fo:conditional-page-master-reference page-position="first" master-reference="firstpage"/> <fo:conditional-page-master-reference page-position="rest" master-reference="restpage"/> <fo:conditional-page-master-reference page-position="any" master-reference="blankpage"/> </fo:repeatable-page-master-alternatives> </fo:page-sequence-master> </fo:layout-master-set> . . . . W3C XSL-FO 仕様 7.25.14 "page-position" の"rest"の説明には次のように書かれています。 This master is eligible for selection if this is not the first page nor the last page in the page-sequence. page-position="rest" は page-position="first"と page-position="last" 以外のページに適応されます。上記のFOにはpage-position="last"を指定した fo:conditional-page-master-reference がありません。
|
Q. | ページシーケンスにて、カラム数を変えるように指定した場合、文字が流し込まれるカラムの数は切り替わるのですが、カラムの幅が最初のページ以降変化しません。なぜですか。 [No.2003021403] |
---|---|
A. |
これは XSL Formatter V2 の制限です。 <fo:layout-master-set> <fo:simple-page-master master-name="master_first" page-height="297mm" page-width="210mm" > <fo:region-body margin="10mm" column-count="3"/> </fo:simple-page-master> <fo:simple-page-master master-name="master_rest" page-height="297mm" page-width="210mm"> <fo:region-body margin="10mm" column-count="2"/> </fo:simple-page-master> <fo:simple-page-master master-name="master_last" page-height="297mm" page-width="210mm"> <fo:region-body margin="10mm" column-count="2"/> </fo:simple-page-master> <fo:page-sequence-master master-name="main-sequence"> <fo:repeatable-page-master-alternatives> <fo:conditional-page-master-reference master-reference="master_first" page-position="first"/> <fo:conditional-page-master-reference master-reference="master_rest" page-position="rest"/> <fo:conditional-page-master-reference master-reference="master_rest" page-position="last"/> </fo:repeatable-page-master-alternatives> </fo:page-sequence-master> </fo:layout-master-set> <fo:page-sequence master-reference="main-sequence"> <fo:flow flow-name="xsl-region-body"> . . . </fo:flow> </fo:page-sequence> この例の場合、本来は1ページ目には3段組が作成され、次ページ以降は2段組となります。しかし、XSL Formatter はフロー内部で段組数を切り替えることができません。したがって、2ページ目以降も3段組が作成されてしまいます。(ただし、文字が流し込まれるのは2段組目までです)
|
Q. | 任意の位置で改ページ、または改カラムしたいのですが、どうすればいいですか。 [No.2003031401] |
---|---|
A. |
'fo:break-after' プロパティか、'fo:break-before' プロパティを使用すれば、任意の場所で改ページ/改カラムすることができます。
|
Q. | z-indexの値をそれぞれ"1"と"10"と指定した場合、"1"で指定されているブロックが背面に、"10"が指定されているブロックが前面に表示されるはずですが、そのようにならないのはなぜですか。 [No.2003040401] |
---|---|
A. |
z-index は親FOの z-index からの相対値で指定します。したがって、プラスの値は前面に配置されます。マイナスの値が指定された場合は、背面に配置されます。 5.4.5 z-index Property The value is converted to one that is absolute; i.e., the refined value is the specified value plus the refined value of z-index of its parent formatting object, if any. プラス値、 マイナス値以外の場合は z-index="0" となります。 |
Q. | footnote が次のページに送られたが、オーバーフローする場合があります。また、1ページに入りきらない大きな footnote-body があるときもオーバーフローしてしまいます。 [No.2003052302] |
---|---|
A. |
これは XSL Formatter の制限です。
footnote が次のページに送られても、次のページでエリアが不足した場合はオーバーフローしてしまいます。
この問題は XSL Formatter V2.5 改訂2版で修正されました。ただし、XSL Formatter は footnote の途中で改ページができません。 |
Q. |
fo:page-sequence-master で、maximum-repeats を指定した fo:repeatable-page-master-alternatives と fo:single-page-master-reference が混在するとエラーが発生する場合があります。
[No.2003080101]
|
---|---|
A. |
次のような <fo:page-sequence-master master-name="main"> <fo:repeatable-page-master-alternatives maximum-repeats="10"> <fo:conditional-page-master-reference odd-or-even="odd" master-reference="one"/> <fo:conditional-page-master-reference odd-or-even="even" master-reference="two"/> </fo:repeatable-page-master-alternatives> <fo:single-page-master-reference master-reference="blank_1"/> <fo:repeatable-page-master-alternatives maximum-repeats="4"> <fo:conditional-page-master-reference odd-or-even="even" master-reference="two"/> <fo:conditional-page-master-reference odd-or-even="odd" master-reference="one"/> </fo:repeatable-page-master-alternatives> </fo:page-sequence-master> この問題につきましては XSL Formatter V2.5 改訂3版 にて修正されました。 |
Q. |
テーブルセル内の文字をセルの底部に移動させるために
<fo:table-cell vertical-align="bottom">
を指定したのですが、文字が移動してくれません。どうすればいいですか。
[No.2002030805]
|
---|---|
A. |
この場合は
|
Q. | セルが複数ページにまたがったり、次のページに押し出されたときに、ページの最後のセル罫線を残しておきたい。 [No.2002031803] |
---|---|
A. |
fo:tabe-cell プロパティに |
Q. |
テーブルのカラム間にスペースを作るため border-spacing=".2in 0pt" margin-left="-.2in" や margin-right="-.2in" を指定しました。V1.1ではうまくいったのに、V2.2ではスペースができません。なぜですか。
[No.2002052403]
|
---|---|
A. |
これはstart/end-indent の継承の問題です。V2でstart/end indentがXSL勧告仕様に準拠したからです。V1.1では準拠していませんでした。
<fo:table-body start-indent="0in" end-indent="0in"> |
Q. | テーブルのカラム間だけにボーダーを作る方法はありますか。 [No.2002053102] |
---|---|
A. |
次のようにするとtableのまわりのborderを消すことができます。 <fo:table border-collapse="collapse" border-style="hidden"> |
Q. | border-after とconditionality retain を fo:table-header に指定し、border-after を fo:table-cell にも指定して、テーブルヘッダーの下にボーダーを引きたかったのですが、できません。なぜですか。 [No.2002062103] |
---|---|
A. |
fo:table に border-collapse="separate" が指定されている場合、 fo:table-header の border や padding は無効になります。 XSL 仕様の次のようなところを見ればわかるかと思います。 6.7.6 fo:table-header ...... The following properties apply to this formatting object: ...... * [7.7 Common Border, Padding, and Background Properties] NOTE: Only the background properties from this set apply. If the value of border-collapse is "collapse" or "collapse-with-precedence" for the table the border properties also apply. border-collapse が "collapse" でも "collapse-with-precedence" でもない 場合(つまり "separate" の場合)、border、padding は適用されない。 ...... 7.26.5 "border-separation" ...... In the separate borders model, each cell has an individual border. The "border-separation" property specifies the distance between the borders of adjacent cells. This space is filled with the background of the table element. Rows, columns, row groups, and column groups cannot have borders (i.e., user agents must ignore the border properties for those elements). table-header というのは row groups のひとつです。その border は無視し なければならないと明記されています。 |
Q. | 表のセルの内容がページまたがりを起こした場合、そのセル情報全てを次のページに表示させることが可能でしょうか。 [No.2002062809] |
---|---|
A. |
セルの途中での改ページをさせないようにするには、 |
Q. |
テキストを次のカラムにフローさせるために break-before="column" を指定しましたが改行はするのですがテキストはフローしません。fo:block-container 内では break-before="column" は使えないのですか。
[No.2002080601]
|
---|---|
A. |
送付されてきた FO は次のようになっていました。 <fo:block-container block-progression-dimension="6pc"> <fo:block keep-together.within-column="auto"> This is some text. <fo:block break-before="column"/> This is more text that should be in the next column. <fo:block> </fo:block-container> block-container のなかでは、改段できません。table を使ったらどうでしょうか。
またはblock-containerを使う必要があるのなら、 <fo:block-container block-progression-dimension="6pc"> <fo:block> 1A) This is some text. </fo:block> </fo:block-container> <fo:block-container block-progression-dimension="6pc" break-before="column"> <fo:block> 1B) This is more text that should be in the next column. </fo:block> </fo:block-container> <fo:block span="all"/> <fo:block-container block-progression-dimension="6pc"> <fo:block> 2A) This is some text. </fo:block> </fo:block-container> <fo:block-container block-progression-dimension="6pc" break-before="column"> <fo:block> 2B) This is more text that should be in the next column. </fo:block> </fo:block-container> <fo:block span="all"/> 詳しくはこちらのFOファイルを参照してください。 |
Q. | セルの中で、floatさせた画像の左側に文字を持ってきたいがどうすれば良いですか。 [No.2002093011] |
---|---|
A. |
質問のサンプルはこうなっています。 <fo:table-cell> <fo:block>This is the info for the step .. <fo:float float="end"> <fo:block-container> <fo:block> <fo:external-graphic src="url(abc.eps)"/> </fo:block> </fo:block-container> </fo:float> </fo:block> </fo:table-cell> 希望するのは下記のようなレイアウトと理解して、説明します。 +------------------------+ |This is the .---------. | |info for | graphic | | |the step '---------' | +------------------------+ floatのアンカーを"This is..."の前に置いてください。理由ですが、文字列は通常floatが見つかるまで流し込みさて、そしてfloatの位置決めが行われます。 下記の IE or Mozilla でのfloatのコードを見てみてください。 <div> The quick brown fox jumps over the lazy dog. <div style="float:right; width:2cm; background: yellow">Here is float</div> </div> floatの位置は"The quick brown..."と同じ位置(線上)に置かれます。 次に、floatの幅はその内容によって決められます。 block-containerの幅はこの祖先(この場合、table-cellですが)と同じ幅と解釈されますのでblock-containerの幅は指定しません。 もし、fo:block-containerの代わりにfo:blockを使用するならば、floatの幅はその内容によって幅が決まります。 下記に修正したコードを付けましたので、参考にしてください。 <fo:table-cell> <fo:block> <fo:float float="end"> <fo:block> <fo:external-graphic src="url(abc.eps)"/> </fo:block> </fo:float>This is the info for the step .. </fo:block> </fo:table-cell> |
Q. | 横にスパンされたカラムに文字を配置したところ、行が折り返されずにカラム幅が伸びて、一行で組版されます。これは不具合ではないでしょうか。 [No.2002093014] |
---|---|
A. |
この問題は不具合ではありません。それは W3C Recommendation から参照されているCSS2の仕様によるものです。 (こちらを参照してください:http://www.w3.org/TR/REC-CSS2/tables.html#width-layout) CSS2ではtable-layout="auto" (デフォルト)ときの動作は決定されておらず、組版プログラムに任されています。よって、XSL Formatter V2.2では、table-layout="auto" (デフォルト)のときは、スパンされたカラムに限り、カラムサイズを変更して、文字列が1行になるようにしています。 解決方法としては、fo:table に column-width の合計の width を指定してください。これによってテーブル全体幅が固定され、カラム幅が変更されることが防げます。 なお、XSL Formatter V2.3ではこれを修正して、table-layout="auto" (デフォルト)が指定され、なおかつスパンされていても、スパンされてないカラムと同様に、行を改行してカラムに収めるように変更されました。 |
Q. | テーブル幅が本文領域の幅より広いときに、小口側(外側)のマージンに揃えて表示したいがどうすれば良いか。 [No.2002101802] |
---|---|
A. |
これは
|
Q. | 大きさを指定しない、隣り合うセルの一方は罫線なし、もう一方は罫線ありを指定したところ、罫線のないセルのテキストが改行されてしまいました。なぜでですか。 [No.2002110804] |
---|---|
A. |
これはXSL Formatter V2.3までのAutomatic table layout アルゴリズムの不具合でした。 次がFOの一部です。 <table border-collapse="collapse-with-precedence"> <table-body> <table-row> <table-cell border-end-precedence="9" border-end-style="hidden" border-end-width="2pt"> <block>r1c1</block> </table-cell> <table-cell border-start-precedence="10" border-style="solid" border-start-width="2pt"> <block>r1c2</block></table-cell> </table-row> </table-body> </table> セルの内容の幅をもとにしてカラム幅を決めるのですが、そのとき、セルに指定されているborder幅も考慮します。 この問題につきましては XSL Formatter V2.4 にて修正されました。 |
Q. | ネストしたテーブル内にて改ページされた場合、テーブル全体が次ページに移動してしまいます。なぜですか。 [No.2002110805] |
---|---|
A. |
これは XSL Formatterの制限事項です。ネストしたテーブル内で改ページさせることができません。ご了承ください。 XSL Formatter V3 にはこの制限はありません。 |
Q. | 複数のカラムから成るテーブルを作成して一つのカラムにだけcolumn-width で1つのカラムに幅を指定しました。しかし指定したカラムの幅が、column-widthで指定した値より広くなっています。なぜでしょうか。 [No.2002110808] |
---|---|
A. |
次にFOの例を示します。 <fo:table table-layout="auto" inline-progression-dimension="100%"> <fo:table-column column-width="2in"/> <fo:table-column/> <fo:table-column/> <fo:table-column/> <fo:table-body> <fo:table-row> <fo:table-cell border-start-style="solid" border-before-color="black"> <fo:block> Row 1 Cell 1 </fo:block> </fo:table-cell> <fo:table-cell border-start-style="solid" border-before-color="black" > <fo:block> Row 1 Cell 2 </fo:block> </fo:table-cell> ...... ...... </fo:table-row> </fo:table-body> </fo:table> table-layout="auto" の場合、column-width で指定した幅のとおりにはならないことがあります。これは、Automatic table layout のアルゴリズムによります。
column-widthに指定された値は、column の最小の幅になります。table の inline-progression-dimension が指定されていてその値が column 幅から決まるテーブルの幅よりも大きいときは、column 幅にその分の幅が分散されて追加されます。
|
Q. | ページマスタを変えないで、複数のページにまたがったテーブルを回転させることは可能ですか。 [No.2002121303] |
---|---|
A. |
テーブルを回転させるので、reference-orientationを使用することになると思います。
XSL Formatter V3 にはこの制限はありません。 |
Q. | 1ページに収まらないテーブルを作成したところ、問題なくはみ出した分を次ページに表示する場合と、オーバーフローエラーが発生して、はみ出した分がなくなってしまう場合があります。なぜですか。 [No.2002122005] |
---|---|
A. |
XSL Fomatter V2 では fo:table がネストされた場合、改ページすることができず、オーバーフローエラーが発生してしまいます。この問題は XSL Formatter V2 での制限事項です。
<xsl:template match="paragraph"> <fo:table> <fo:table-body width="165mm"> <fo:table-row width="165mm"> <fo:table-cell width="25mm"> <fo:block id="{@link_id}" font-size="12pt" font-family="Arial"> <xsl:value-of select="@number"/> </fo:block> </fo:table-cell> <fo:table-cell width="140mm"> <fo:block font-family="Arial" font-size="12pt" text-align="justify"> <xsl:apply-templates/> </fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </xsl:template> paragraph 全体が fo:table で実現されるようになっていて、その paragraph 内に table があると fo:table のネストになります。
<xsl:template match="paragraph"> <fo:list-block provisional-distance-between-starts="25mm"> <fo:list-item> <fo:list-item-label end-indent="label-end()"> <fo:block id="{@link_id}" font-size="12pt" font-family="Arial"> <xsl:value-of select="@number"/> </fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()"> <fo:block font-family="Arial" font-size="12pt" text-align="justify"> <xsl:apply-templates/> </fo:block> </fo:list-item-body> </fo:list-item> </fo:list-block> </xsl:template> 併せて、本当に table を出力するところでは、 XSL Formatter V3 には、この制限はありません。 |
Q. | 表がページにて分割されたとき、表のヘッダを表示させないようにすることは可能ですか。 [No.2003011001] |
---|---|
A. |
可能です。 fo:table の table-omit-header-at-break(ヘッダーの省略)プロパティをtrueで指定するとヘッダは表示されません。table-omit-header-at-breakプロパティのdefaultは"false"で、改ページしても table-header は出力されます。 |
Q. | 表の後に8mmの余白をキープしたいが、表がオーバーフローするとき、表の最後だけでなくオーバーフロー前の表の下にも8mmの余白を生成してしまうのはなぜですか。 [No.2003011005] |
---|---|
A. |
space-after="8mm" space-after.conditionality="retain" という指定により、 space-after は reference-area の最後にあっても残ります。
|
Q. | table-cell 内の block-container に reference-orientation="270" を指定して、文字列全体を回転させたいのですが、文字だけが回転してしまいます。なぜですか。 [No.2003011006] |
---|---|
A. |
この場合、cellのcontentsの高さ指定する必要があります。
6.7.10 fo:table-cell The method for determining the block-progression-dimension of the cell in the grid is governed by the row-height trait. よって、table-cell 内の block-container に inline-progression-dimension を指定する必要があります。 |
Q. | fo:table に border を指定して、そのテーブルの途中で改ページした場合に border の描画が正しくありません。 [No.2003090506] |
---|---|
A. |
この問題は、以下の条件に全て一致したテーブルがあり、そのテーブル内で改段や改ページが発生したときに発生します。
fo:table-header や fo:table-footer が使用されていない場合は問題は発生しません。
また、border-width が細線(1pt)程度であれば、ほとんど目立ちません。
この問題は XSL Formatter V2の制限事項です。 XSL Formatter V3 はこの制限はありません。 |
Q. | ページの幅よりも大きな幅のテーブルがはみ出した時、はみ出した分を別のページに出力することは可能ですか。 [No.2004061501] |
---|---|
A. |
ページの横幅より大きなテーブルがはみ出しても、そのはみ出した分は出力されません。XSL-FOの仕様ではそのような機能はありません。 |
Q. | レイアウトカラム数-1のカラムを段抜き(span)することはできますか。 (例:3カラムの内、2カラムだけを段抜きすることはできるか。) [No.2002030105] |
---|---|
A. |
指定できません。段抜き(span)の指定は span="all" か span="none" のみです。 |
Q. | 全てのページが2段組のドキュメントを作成すると、2段目の終わりに空きができてしまう。1段目と2段目の縦の長さを揃えて縦方向にブロックを均等寄せする機能はありますか。 [No.2002071204] |
---|---|
A. |
XSL仕様ではこのような機能はありません。しかし、 |
Q. | 2段組を行い、脚注エリアの脚注文書が先の2段組の各カラムの下に配置されるようにしたいのですが、これは可能ですか。 [No.2002090604] |
---|---|
A. |
footnote単体に段組はできません。XSL V1勧告仕様では footnote-body のエリアの幅は region-body の幅と同じになります。 The fo:footnote is typically used to produce footnote-citations within the region-body of a page and the corresponding footnote in a separate area nearer the after-edge of the page. Additionally, an fo:footnote is not permitted to have as a descendant an fo:block-container that generates an absolutely positioned area. なお、XSL Formatter の拡張機能「axf:footnote-position」を使用すれば、脚注を、段ごとに配置することができます。詳しくはXSL Formatter のオンラインマニュアルをご覧ください。 |
Q. | 3列のカラムに2列目までかかる画像を配置しました。このとき、カラムを span="all" したときと同じようにテキストを配置することはできますか。 [No.2003022103] |
---|---|
A. |
できません。将来のバージョンにて対応できるか検討しています。 |
Q. | GUI ではフッターが表示されるのに、プリンタで印刷するとフッターが印刷されません。なぜですか。 [No.2002060701] |
---|---|
A. |
送付された FO は次のようになっていました。 <fo:layout-master-set page-height="11in" page-width="8.5in"> <fo:simple-page-master master-name="first_page"> スタイルシートでの用紙サイズの指定の仕方が違っています。レターサイズを指定したつもりが、なにも指定されてないことになるので、XSL Formatter はデフォルトのA4を採用します。A4サイズなら入るはずのフッターの部分がレターサイズでは、はみ出て印刷されないのです。
<fo:layout-master-set> <fo:simple-page-master master-name="first_page" page-height="11in" page-width="8.5in"> |
Q. | ページ内にある複数のfootnoteが同じfootonoteを参照するようにしたいのですが可能ですか。 [No.2003051605] |
---|---|
A. |
XSL-FOでは同一参照のfootnoteはサポートしていませんので、不可能です。
|
Q. | ページの内容をヘッダやフッタに出力したい。 [No.2003051606] |
---|---|
A. |
カレントページのcontentsとヘッダやフッタの内容は、fo:marker と fo:retrieve-marker を使うことで同期させることが可能です。
|
Q. | fo:footnote がアンカーと同じページに出力されない場合がある。 [No.2003072503] |
---|---|
A. |
XSL Formatter はアンカーと同じページに正常に配置できないときは footnote を次のページに配置することがあります。
これについては、
[No.2003011003]
を参照してください。
|
Q. | fo:block margin-top を指定したいのですが、改ページ直後だけは上マージンを取りたくありません。なにか方法はありますか。 [No.2002030804] |
---|---|
A. |
<fo:block margin-top="10pt" xsl:use-attribute-sets="MIDASHI"> 必要部分へのマージンとして、上記のように設定されているとします。margin-top はCSS2との互換として用意され、XSLでは space-before と同じ扱いです。しかし一部違いがあり、margin-top は space-before.conditionality="retain" として解釈されてしまい、結果として改ページ直後であってもマージンがつけられてしまいます。よって 、<fo:block space-before="10pt" xsl:use-attribute-sets="MIDASHI"> と、修正すれば良いでしょう。 |
Q. | margin-left プロパテイを指定していると、テキストの進行方向を右から左にして、テキスト進行方向を変えても、ページエリアが変化しません。なぜでしょうか。 [No.2002031804] |
---|---|
A. |
margin-left というのは、writing-mode にかかわらず、left は絶対 left というのが XSL の仕様です。writing-mode で左右上下を変えるときには、start-indent、end-indent、space-before、space-after を使ってください。 |
Q. | blockに'margin-left'プロパティを使用してインデントを付けたのですが、このblockの子要素のテーブル内までインデントされてしまいました。なぜですか。 [No.2002101806] |
---|---|
A. |
これは継承によるものです。 W3C Recommendationでは、親要素にて指定されたプロパティが子要素にまで影響するプロパティがあります。これを「継承」と言っています。 'margin-left'プロパティは本来継承されないプロパティです。ただし margin-left は start-indent に変換されて処理されることになっていて、 start-indent の方が継承されるプロパティとなっています。 start-indent = margin-corresponding + padding-corresponding + border-corresponding-width end-indent = margin-corresponding + padding-corresponding + border-corresponding-width (W3C Recommendation Extensible Stylesheet Language 5.3.2をご覧ください) したがって、指定した margin-left は( border、padding が0であるならば) start-indent を指定したのと同じことになり、テーブル内にまで継承されます。 もし、テーブルに start-indent / end-indnet を継承させないようにするためには、 table-body / table-header / table-footer に start-indent="0cm" とすれば良いです。 |
Q. | from-nearest-specified-value を使用してインデント指定したのですが、インデントされません。 [No.2002112202] |
---|---|
A. |
次のようなFOを組版させた場合、インデントされません。 <fo:block start-indent="from-nearest-specified-value(start-indent) + 1cm"> First line <fo:block start-indent="from-nearest-specified-value(start-indent) + 1cm"> Second line <fo:block start-indent="from-nearest-specified-value(start-indent) + 1cm"> Third line </fo:block> </fo:block> </fo:block> 組版結果は下記のような結果になってしまいます。 First line Second line Third line これはXSL Formatter V2.3 までの不具合でした。本来は下記のようにインデントされなければなりません。 First line Second line Third line この問題はXSL Formatter V2.4 にて修正されました。 |
Q. | fo:block に end-indent と last-line-end-indent を指定したとき、本来なら1行に収まるはずのテキストが leader-pattern を指定した所で改行されてしまい、残りのテキストが次行の先頭に配置されてしまいます。 [No.2002112203] |
---|---|
A. |
次のようなFOを組版させた場合、fo:leader leader-pattern="dots"の後ろのテキストが次行の先頭に配置されてしまう場合があります。 <fo:block font-size="10pt" line-height="12pt" start-indent="1.5pc" text-align-last="justify" end-indent="3pc" last-line-end-indent="-3pc"> AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH IIII JJJJ KKKK LLLL MMMM OO <fo:leader leader-pattern="dots"/> Z </fo:block> これはXSL Formatter V2.3までの不具合でした。この問題は XSL Formatter V2.4 にて修正されました。 |
Q. | space-before と margin-top プロパティを同時に指定しましたが、space-before が有効になりません。 [No.2003081502] |
---|---|
A. |
XSL-FO仕様には次のようにあります。 5.11. Property Datatypes If the computed value of a corresponding relative property is set from the corresponding absolute property, the latter is used in determining all the components of the former. For example, assuming a block-progression-direction of "top-to-bottom", in a specification of margin-top="10.0pt" space-before.minimum="4.0pt" the explicit setting of one of the components of the corresponding relative property will have no effect. そのため、このような場合には XSL Formatter は margin プロパティを採用します。他社のソフトウェアとは結果が異なる場合があります。 |
Q. |
fo:list-item-body の子要素の fo:block-container の子要素で "start-indent="0pt" を指定したのですが、開始辺が fo:list-item-body の start-indent の位置になります。なぜですか。
[No.2003081503]
|
---|---|
A. |
サンプルFO: <fo:list-item> <fo:list-item-label text-align="end" end-indent="label-end()"> <fo:block>1.</fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()"> <fo:block-container> <fo:table start-indent="0pt"> <fo:table-body> <fo:table-row> <fo:table-cell> <fo:block>fo:table start-indent="0pt"</fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </fo:block-container> </fo:list-item-body> </fo:list-item> この場合、 |
Q. |
改行させるために <fo:character character="
"/> と、指定しましたが、改行されません。なぜですか。
[No.2002032506]
|
---|---|
A. |
#x0A コードはあくまでも通常の文字コードとして処理されます。そして linefeed-treatment プロパティによって U+0020(space) に変換されます。もし #x0A にて改行処理を行いたいときは、fo:block に
|
Q. | 改行を指定するために "white-space" にpreを指定しました。 改行はするのですが、今度は行末での折り返しをしなくなりました。なぜですか。 [No.2002052402] |
---|---|
A. |
W3C Recommendationには次のように書かれています。 7.29.23 "white-space" CSS2 Definition: ...... The CSS property shall be treated as a shorthand by XSL and maps as follows: pre linefeed-treatment="preserve" white-space-collapse="false" white-space-treatment="preserve" wrap-option="no-wrap"
下記の指定では行は折り返しません。 <xsl:attribute name="white-space"> pre </xsl:attribute> 次のように指定してください。 <xsl:attribute name="linefeed-treatment"> preserve </xsl:attribute> <xsl:attribute name="wrap-option"> wrap </xsl:attribute> |
Q. | XMLとXSLをXSLFormaterに指定して組版して、なんのエラーもなく終了しました。ところがドキュメントの途中で一部、幅が狭いページが作成されていました。なぜですか。 [No.2002053103] |
---|---|
A. |
fo:character が間違った使い方をされています。fo:character は1文字を指定するものであるのに、複数文字が指定されています。 <fo:character character="Glossary "/> や <fo:character character=", "/> (コンマとスペースの2文字)など。 これらは、XSL の仕様上、誤りです。この現象を避けるには、複数文字の fo:character を、fo:character を使用しないテキストに直してください。 |
Q. | 絶対位置指定をするために position="absolute" を使用しましたが、指定した位置に表示されません。なぜですか。 [No.2002071901] |
---|---|
A. |
スタイルシートを拝見しましたら、次のように指定されていました。 <fo:block position="absolute" top="10mm" right="30mm"> This text should be positioned ? </fo:block> position="absolute" プロパティは fo:block には指定できません。fo:block-container に指定してもらう必要があります。次のように指定してください。 <fo:block-container position="absolute" top="10mm" right="30mm"> <fo:block>This text should be positioned ?</fo:block> </fo:block-container> |
Q. | テキストの体裁を整えるために空白を使用したのですが、連続した空白が削除されてしまいます。なぜですか。 [No.2002071902] |
---|---|
A. |
これは <fo:block white-space-treatment="preserve" linefeed-treatment="preserve" white-space-collapse="false"> apple 4, 7, 7, 12 </fo:block> |
Q. | カラムの高さを整えるために fo:block に "block-progression-dimension" を指定したのですが、指定通りになりません。また "reference-orientation" を使用してみたのですが、やはりうまくできませんでした。なぜですか。 [No.2002072602] |
---|---|
A. |
"block-progression-dimension" および "reference-orientation" は fo:block には適用されません。fo:block-container を使う必要があります。 |
Q. | word-space を狭くするために、"word-spacing" と "word-spacing.precedence" に 0.3em を指定したが、広くなってしまったのはなぜですか。 また "word-space" のデフォルト値はどの位ですか。 [No.2002091303] |
---|---|
A. |
word-space を狭くするのであれば、"word-spacing" と "word-spacing.precedence" にはマイナス値を指定する必要があります。デフォルト値のスペース量は使用しているフォントのスペース文字の幅になります。ちなみに Times New Roman などの欧文フォントでは 0.25em であることが多いようです。 狭いカラムで単語間のアキが大きくなるというのは、ある程度避けられないことです。XSL Formatter では、justify で文字間まで広げるということはしていませんので、スペースが目立つ場合があります。また hyphenation="true" としても、単語を分割できるところは限られているので、限界があります。ご了承ください。 |
Q. | 改行させたいがどうすればいいか。 [No.2002102506] |
---|---|
A. |
改行させるにはfo:blockで囲むか、fo:blockにlinefeed-treatment="preserve"を指定して、改行したい位置に#x0A(改行コード)を指定すれば改行されます。 |
Q. | block-containerに'text-alain="center"'を指定したのですが、テキストが中央に配置されません。なぜですか。 [No.2002110105] |
---|---|
A. |
FOを見ると次のようになっています。 <fo:simple-page-master master-name="master" page-height="11in" page-width="8.5in"> <fo:region-body/> . <fo:region-start extent="0.5in"/> . </fo:simple-page-master> . . . <fo:static-content flow-name="xsl-region-start"> <fo:block-container reference-orientation="90"> <fo:block text-align="center"> content text. </fo:block> </fo:block-container> </fo:static-content> block-containerにサイズの指定がない場合、block-containerのreference-areaのサイズは、自動的に内容の大きさ(幅)になります。よって'text-alain="center"'の効果はありません。そしてこのreference-areaはregion-reference-areaのbefore-edge側に配置されます。もし、中央に配置したい場合は、fo:region-startに display-align="center"を指定してください。 |
Q. | 組版中に「Area overflow: fo:block-container (page 1)」というエラーメッセージがでますが、理由がわかりません。なぜですか。 [No.2002110106] |
---|---|
A. |
送られてきたファイルは次のようになっています。 <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="master1" page-height="11in" page-width="8.5in"> <fo:region-body/> <fo:region-after extent="0.5in"/> <fo:region-before extent="0.5in"/> <fo:region-start extent="0.5in"/> <fo:region-end extent="0.5in"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="master1" font-size="12pt"> ... <fo:flow flow-name="xsl-region-body" display-align="center"> ... <fo:block-container writing-mode="tb-rl" inline-progression-dimension="20%" block-progression-dimension="100%"> <fo:block> This is a content. This is a content. This is a content. </fo:block> </fo:block-container> </fo:flow> </fo:page-sequence> </fo:root> エラーがでるのは、fo:block-containerにblock-progression-dimension="100%"と設定しているためです。
XSL Formatter V2.3改訂1版までは、block-progression-dimensionを比率で指定すると、最も近い先祖の対応寸法から計算します。
このように回転した場合にパーセント値の基準をどこから取得するべきかは、XSL仕様では明確ではありません。将来のバージョンでは、パーセント値の基準のと り方を変更するかもしれません。参照エリアを回転している場合、その大きさにパーセント値を指定することは避けるようにしてください。 |
Q. | fo:flow の直下に 'writing-mode'を指定したblock-containerがあるFOを組み版したところ、最初の1ページは出力されたのですが次のページから表示されません。なぜですか。 [No.2002111503] |
---|---|
A. |
fo:block-container の途中での改ページができないというのは、XSL Formatter V2 の制限事項です。 XSL Formatter V3 にはこの制限はありません。 |
Q. | list-blockが2ページに跨った場合、list-item-body 内の block に指定した space-after が、改ページ直後では無視されてしまいます。なぜですか。 [No.2002112901] |
---|---|
A. |
この問題は XSL Formatter V2.3までの不具合でした。
<fo:list-item> <fo:list-item-label> <fo:block text-align="end"> 1 </fo:block> </fo:list-item-label> <fo:list-item-body> <fo:block space-after="1.0em"> aaa </fo:block> </fo:list-item-body> </fo:list-item> <fo:list-item> <fo:list-item-label> <fo:block text-align="end"> 2 </fo:block> </fo:list-item-label> <fo:list-item-body> <fo:block space-after="1.0em"> bbb </fo:block> </fo:list-item-body> </fo:list-item> <fo:list-item> <fo:list-item-label> <fo:block text-align="end"> 3 </fo:block> </fo:list-item-label> <fo:list-item-body> <fo:block space-after="1.0em"> ccc </fo:block> </fo:list-item-body> </fo:list-item> この FO で、"aaa" の list-item と "bbb" の list-item の間で改ページが発生した場合、"bbb" の fo:block で指定した space-after="1.0em" が無視されてしまいました。
<fo:list-item space-after="1.0em"> <fo:list-item-label> <fo:block text-align="end"> 1 </fo:block> </fo:list-item-label> <fo:list-item-body> <fo:block> aaa </fo:block> </fo:list-item-body> </fo:list-item> |
Q. | text-decorationにてunderlineを指定しました。しかし、white-space-collapse="false"を指定したのにもかかわらず、スペースにアンダーラインが引かれません。なぜですか。 [No.2002122009] |
---|---|
A. |
これはXSLの仕様です。'text-decoration' は text content だけに有効なプロパティです。text content ではないスペースには適応されません。次のW3C仕様書を参考にしてください。 -------------------------------------------------- 7.16.4 "text-decoration" CSS2 Definition: ... If the element has no content or no text content (e.g., the IMG element in HTML), user agents must ignore this property. |
Q. | list-blockごとcenterやrightに移動させることはできますか。 [No.2003011002] |
---|---|
A. |
これはできません。
<fo:block text-align="center"> <fo:list-block>… と、指定しても、text-alignが適用されるのは、list-item-labelとlist-item-bodyの中のinline contentsになります。 |
Q. |
fo:block-container に absolute-position="absolute" を指定して、top、bottom、right、leftを指定しようと思いますが、それぞれどの位置からの値を指定すれば良いのですか。
[No.2003011701]
|
---|---|
A. |
各値の基準は、その fo:block-container の外側エリアの、次の位置からになります。
|
Q. |
intrusion-displace="block" が有効にならない場合があります。
[No.2003060601]
|
---|---|
A. |
<fo:float float="outside"> <fo:block>* THIS IS A FLOAT *</fo:block> </fo:float> <fo:block intrusion-displace="block"> <fo:block> First Block </fo:block> <fo:block> Second Block </fo:block> <fo:block> Third Block </fo:block> </fo:block> 上記のようなFOで、"Second Block" において改ページが発生した場合、 "Third Block" の XSL Formatter V3.1 にはこの制限はありません。 |
Q. |
fo:list-block やその子要素に span="all" を指定すると、「エラーを特定できません」のメッセージが出力されます。
[No.2003062702]
|
---|---|
A. |
XSL-FO仕様ではリストにspanプロパティを指定することはできません。したがって、メッセージの内容が間違っています。
|
Q. |
fo:block-container 内の fo:page-number が2回出力されることがある。
[No.2003072502]
|
---|---|
A. |
これは幅が指定された |
Q. |
<fo:block/> は空白行になりますか。
[No.2003090501]
|
---|---|
A. |
|
Q. |
fo:block に linefeed-treatment="treat-as-space" が指定されている場合に、
<fo:inline> 直後にある改行(U+0A)が削除されてしまいます。
[No.2003090502]
|
---|---|
A. |
この問題につきましては XSL Formatter V2.5 改訂3版 にて修正されました。 |
Q. | U+200C が fo:block または fo:inline の内容の最後にある場合、XSL Formatter から大量のエラーが表示される、もしくは XSL Formatter が終了してしまいます。 [No.2003090503] |
---|---|
A. |
|
Q. |
段組で、fo:blockにkeep-together.within-page="always" または keep-together.within-column="always" を指定すると、オーバーフローします。
[No.2003090505]
|
---|---|
A. |
XSL Formatter V3 はこの制限はありません。 |
Q. |
fo:block や fo:table-cell に keep-together="always" を指定したのですが有効になりません。
また、keep-together="always" が指定されたエリアでハイフネーションされません。
[No.2003101602]
|
---|---|
A. |
keep-together.within-line="always" keep-together.within-colums="always" keep-together.within-page="always"
<fo:block keep-together="always"> <fo:inline> Sample Contents.... </fo:inline> </fo:block>
なお、XSL Formatter V3 には |
Q. |
<fo:block white-space-collapse="false"> </fo:block> のように fo:block に white-space-collapse="false" を指定しました。しかし、空白行は生成されず、行頭の空白(U+0020)は削除されてしまいます。
空白行の生成や行頭の空白を残すにはどうしたらいいですか。
[No.2003101601]
| ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A. |
行頭および行末の空白の扱いについては、V2/V3.0/V3.1R1 と V3.1MR1 とで扱いが異なります。
V2/V3.0/V3.1R1 における行頭および行末の空白の扱いについては、
行頭/行末の空白を残すには、以下のように <fo:block white-space-collapse="false" usage-context-of-suppress-at-line-break="ignore">   </fo:block>
現在の XSL 1.0 Errata は 7.16.4 "usage-context-of-suppress-at-line-break" XSL Definition: Value: auto | observe | ignore | inherit Initial: auto Applies to: fo:block, fo:inline, fo:page-number, fo:page-number-citation Inherited: yes Percentages: N/A Media: visual This property specifies the usage context of the character property "suppress-at-line-break". It specifies if this character property should apply or not. Values for this property have the following meanings: auto If the value of the "wrap-option" trait on the current formatting object to which the "usage-context-of-suppress-at-line-break" applies is "no-wrap", the "auto" value specifies the same processing of descendant fo:character formatting objects as if "ignore" had been specified for the "usage-context-of-suppress-at-line-break" property. Otherwise it specifies the same processing of descendant fo:character formatting objects as if "observe" had been specified for the "usage-context-of-suppress-at-line-break" property. observe Specifies that descendant fo:character formatting objects should be treated using the computed value of the "suppress-at-line-break" property of the fo:character formatting object. ignore Specifies that descendant fo:character formatting objects should be treated as if the "suppress-at-line-break" property of the fo:character formatting object had the value "retain".
これにより、
XSL Formatter では <fo:block> <fo:character character="' '" suppress-at-line-break="retain"/> </fo:block> XSL Formatter は XSL Formatter V3.1MR1 以降では、最新の XSL 1.0 Errata と XSL 1.1 WD の仕様に適合するように、
|
Q. |
全角空白は text-align="justify" の調整対象になりますか。
[No.2003111703]
|
---|---|
A. |
スペースの扱いには、XSL-FO仕様に以下のような記述があります。 7.16.7 "treat-as-word-space" ... auto The value of this property is determined by the Unicode code point for the character. As the default behavior: The characters at code points U+0020 and U+00A0 are treated as if 'true' had been specified. All other characters are treated as if 'false' had been specified. This property does not automatically apply word spacing to the fixed spaces (U+2000 through U+200A) or the ideographic-space (U+3000). XSL Formatter は均等割り付けの場合のスペースの扱いもこれに従っていますので、全角空白は半角空白と異なり、全角1文字として処理されるため均等割り付けの対象にはなりません。
|
Q. | 英語以外のハイフネーション処理を行う方法を知りたい。 [No.2002011542] |
---|---|
A. |
ハイフネーション処理はハイフネーション辞書によって処理されます。
なお、アンテナハウス株式会社は「XSL Formatter V2」に組み込むことにより、40言語以上のハイフネーションを行なうためのオプション「XSL Formatter ハイフネーションオプション」を用意しています。
|
Q. | ハイフネーションしたい単語の区切りにハイフネーションマークを入れたいのですが、それはXSL-FOではどうやってすればいいのですか。 [No.2002092004] |
---|---|
A. |
Soft Hyphen という特殊文字で、"­"を挿入することで可能です。 func­tio­nality "­" は通常は表示されませんが、そこで分割されるとハイフンに変化してハイフネーションされます。 |
Q. | side-floatを使用して、ドロップキャップを行っていますが、余分な空白ができてしまいます。どうすれば良いですか。 [No.2002093012] |
---|---|
A. |
例を挙げて説明します。 次のFOではこのような問題が起きます。 <fo:block font-size="8pt"> <fo:float float="start"> <fo:block> <fo:inline font-size="30pt">H</fo:inline> </fo:block> </fo:float>ere, we have a crop cap that should be 3-lines high. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. </fo:block> 上記のFOを修正してみました。 <fo:block font-size="8pt"> <fo:float float="start"> <fo:block space-after="-8pt" space-after.conditionality="retain"> <fo:inline font-size="30pt">H</fo:inline> </fo:block> </fo:float>ere, we have a crop cap that should be 3-lines high. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. Now is the time for all good men. </fo:block> ポイントは'space-after="-8pt"'で、これはfloatの中のBlockオプジェクトの空白の後ろを削除するものです。
そして、'space-after.conditionality="retain"'はspace-afterに指定して、referenceエリアのafter-edgeに有効なのです。
|
Q. | side-float の中に、fo:blockを配置してその内容として文字列を入れました。 そうしたところside-floatの幅がregion-bodyの幅一杯になってしまいました。 floatの幅はどのように決まるのでしょうか。 [No.2002093015] |
---|---|
A. |
fo:floatの幅は、その内容により決まります。XSL-FO 仕様に次のようにありま す。 6.10.2 fo:float ... Side-floats derive their length in the inline-progression-dimension intrinsically from their child areas; the length is not determined by an explicit property value. しかし、XSL-FO 仕様ではside-floatの内容が幅をもたない場合のことが規定されていません。 Side-floats derive their length in the inline-progression-dimension intrinsically from their child areas という文章からはfo:float の内容は、行の折り返しのある段落であるということは想定されていないかのようです。 fo:float に直接 inline-progression-dimension (width) を指定できない仕様ですので、このような場合の対処方法としては、fo:float 内に fo:block-container を入れて、inline-progression-dimension を指定してください。 |
Q. | 本文エリアのテキストとfloat内のテキストの間をあけたいのですが、どうすれば良いですか。 [No.2002101803] |
---|---|
A. |
例を挙げてみます。次のようなFOを記述した場合、本文エリアのテキストとfloat内のテキストが、隣同士になってしまいます。 <fo:float float="start"><fo:block-container> <fo:block border-style="solid" border-color="black" border-width="1pt"> <fo:block start-indent="1em" text-align="justify"> フロートその1です。フロートその1です。フロートその1です。 </fo:block> </fo:block> </fo:block-container> </fo:float> そこで、下記のようにfloatの子要素のblockにインデントを指定することで、間をあけることができます。 例では「fo:float float="start"」ですので、子要素のblock-containerに「end-indent」を指定します。 <fo:float float="start"> <fo:block-container end-indent="1em"> <fo:block border-style="solid" border-color="black" border-width="1pt"> <fo:block start-indent="1em" text-align="justify"> フロートその1です。フロートその1です。フロートその1です。 </fo:block> </fo:block> </fo:block-container> </fo:float> 下記は「fo:float float="end"」に、「start-indent」を指定しています。注意する点ですが、block-containerにstart-indentを指定していますが、その子要素のblockで再度start-indentによって文字揃えを行っています。このままですと、block-containerで指定したstart-indentの継承が切れてしまいますので、inheritを使用して以前のインデント値を加えています。 <fo:float float="end"> <fo:block-container start-indent="1em"> <fo:block border-style="solid" border-color="black" border-width="1pt"> <fo:block start-indent="1em+inherit" text-align="justify"> フロートその2です。フロートその2です。フロートその2です。 </fo:block> </fo:block> </fo:block-container> </fo:float> |
Q. |
floatの後のテキストに intrusion-displace="block" が適用されません。
[No.2003071803]
|
---|---|
A. |
<fo:block intrusion-displace="block"> <fo:float float="end"> <fo:block>float text</fo:block> </fo:float> Sample Text Sample Text </fo:block> 以下のようにテキストの部分を <fo:block intrusion-displace="block"> <fo:float float="end"> <fo:block>float text</fo:block> </fo:float> <fo:block>Sample Text Sample Text</fo:block> </fo:block> この問題は XSL Formatter V2 の制限事項です。 XSL Formatter V3.1 にはこの制限はありません。 |
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: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. |
Q. | fo:blockにインデント指定をしていないのに、インデントされてしまうのはなぜですか。(なぜ、意図しない書式になってしまうのか。) [No.2002111508] |
---|---|
A. |
これはインデントに限ったことではありません。意図しない書式になってしまう原因の大半は「継承」による問題です。まずは「継承」を疑ってみてください。
W3C Recommendation |
Q. | 索引の重複ページ番号参照を除去する「アンテナハウス XSL 拡張仕様」プロパティ 「axf:suppress-duplicate-page-number」で重複ページの除去を試みました。しかし fo:page-number-citation を basic-linkで囲んでいる部分の重複が削除できません。 [No.2002093007] |
---|---|
A. |
V2.2までは、axf:suppress-duplicate-page-number の仕様による制限で fo:page-number-citation どうしは「兄弟関係」にあることが条件でした。basic-link で囲むと「兄弟関係」ではなくなるためです。しかし、V2.3からはこの制限をなくしました。よってこの場合でも問題なく重複ページ除去が行えます。 |
Q. |
axf:document-info を使ってPDFへ文書情報を埋め込んだのですが、Acrobatで見ると途中までしか表示されません。
[No.2003080801]
|
---|---|
A. |
XSL Formatter は全てのデータをPDFに埋め込んでいます。しかし、PDFの仕様書には、Acrobat が ダイアログの表示を 255バイトに制限している、との記載があります。
XSL Formatter V2.5 PDF出力オプション改訂2版で、PDFDocEncoding だけで表現可能な文字のみの場合、PDFDocEncodingで出力するように変更しました。この場合も、Acrobatの制限を越える場合は、途中までの表示となります。 |
Q. | ページに透かしを入れたいのですが、どうすればいいですか。 [No.2004061502] |
---|---|
A. |
XSL Formatter V3 の拡張仕様には、 組版サンプルページのグラフィックスの見本にSVGを使ったサンプルがあります。 |
Q. | XSLTスタイルシートで処理した文書の目次を作りたいのですが、可能でしょうか。 [No.2002011544] |
---|---|
A. |
XSLTで変換する際、本XML文書で、目次に出力したい項目を取り出すことで目次を出力できます。目次のページ番号の出力方法は、サンプルを参照してください。 |
Q. | 自動的に、ページ内の選択した項目の個数をカウントして、カウント数をページ内に挿入することはできますか。 [No.2002120607] |
---|---|
A. |
残念ながら、XSL Formatterでは不可能です。将来のバージョンにて対応できるか検討中です。 |
Q. | XSLスタイルシートにて、節番号、リスト番号をイロハ順に番号生成することは可能ですか。 [No.2003011004] |
---|---|
A. |
スタイルシート内の自動番号生成で、
XSLTの仕様書7.7.1 Number to String Conversion Attributes format="ア" specifies Katakana numbering format="イ" specifies Katakana numbering in the "iroha" order と、書かれていますのでご参考にしていただければと思います。 ただしXSLTプロセッサがサポートしている必要があります。 弊社では MSXML4 にて可能であることを確認しています。 |
Q. | テーブルセル内に fo:inline を作成したところ、テーブルセルがページの右側にはみ出てしまいます。どこに問題があるのですか。 [No.2003011705] |
---|---|
A. |
XSL-FOには次のようになっていました。 <fo:table-cell margin-top="10pt" margin-bottom="10pt" font-weight="bold"> <fo:block text-align="justify" keep-together="always"> アーク放電 </fo:block> <fo:block text-align="justify" keep-together="always"> <fo:inline font-weight="bold"> 気体放電の一つ。電流が両極間の気体中を大きな密度で流れ、強い発熱と発光を伴う。 </fo:inline> </fo:block> </fo:table-cell> fo:block に keep-together="always" が指定されています。keep-together は
'within-page'、'within-column'、'within-line' のコンポーネントを持っていますので、keep-together="always" とすると、この3つに "always" を指定したことになり、keep-together.within-line="always"となります。
<fo:table-cell margin-top="10pt" margin-bottom="10pt" font-weight="bold"> <fo:block text-align="justify" keep-together.within-page="always"> アーク放電 </fo:block> <fo:block text-align="justify" keep-together.within-page="always"> <fo:inline font-weight="bold"> 気体放電の一つ。電流が両極間の気体中を大きな密度で流れ、強い発熱と発光を伴う。 </fo:inline> </fo:block> </fo:table-cell> |
Q. | 組版結果に、組版(印刷)した日付を埋め込むことはできますか。 [No.2003013105] |
---|---|
A. |
XSLスタイルシートにスクリプトを使用すれば可能です。(ただしこれはXSLTの拡張機能ですので、XSLTプロセッサに依存します。ご注意ください)
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <!-- msxsl:script 年月日の取得 --> <msxsl:script language="JScript" implements-prefix="user"> function date(nodelist) { var DateObj = new Date() return DateObj.getFullYear() + "年" + (DateObj.getMonth() +1 )+ "月" + DateObj.getDate() + "日"; } </msxsl:script> -----中略---- <!-- 作成日の出力 --> <fo:block text-align="right"> 作成日:<xsl:value-of select="user:date()"/> </fo:block> |
Q. | 総ページ数を出力させたいが、正しく出力できない。 [No.2003051602] |
---|---|
A. |
FOは次のようになっていました。 <fo:page-sequence-master master-name="PageMaster"> ... <fo:conditional-page-master-reference master-reference="last-page-left" odd-or-even="even" blank-or-not-blank="not-blank" page-position="last"/> <fo:conditional-page-master-reference master-reference="blank-page" odd-or-even="even" blank-or-not-blank="blank" page-position="last"/> </fo:page-sequence-master> ... <fo:page-sequence master-reference="PageMaster" force-page-count="end-on-even"> ... <fo:static-content flow-name="first-and-rest-footer"> <fo:block> Total number of pages = <fo:page-number-citation ref-id="LastPage" /> </fo:block> </fo:static-content> <fo:static-content flow-name="last-page-left-footer"> <fo:block id="LastPage" /> </fo:static-content> <fo:static-content flow-name="blank-page-footer"> <fo:block id="LastPage-blank" /> </fo:static-content> .... page-position="last" が指定されたページが2つあります。
そして、総ページ数、つまり最終ページのページ番号を参照するIDは、片方のみのページにあるblockのIDを示しています。
|
Q. | XSLTスタイルシートで xsl:script を使うとエラーになります。 [No.2003051603] |
---|---|
A. |
xsl:scriptはXSLT1.1で追加された仕様です。
お使いのXSLTプロセッサがサポートしているかどうかを確認してください。
XSL FormatterはデフォルトでMSXMLを使用します。 |
Q. | 文字を大文字や小文字に変換させたい。 [No.2003051604] |
---|---|
A. |
text-transformプロパティを使用すれば、文字を変換させることができます。
|
Q. |
fo:page-number-citation の参照先が <fo:wrpper id="target" /> のように空の fo:wrapper だったときにページ番号が表示されません。
[No.2003052303]
|
---|---|
A. |
XSL-FO仕様には次のように書かれています 6.6.11 fo:page-number-citation The fo:page-number-citation is used to reference the page-number for the page containing the first normal area returned by the cited formatting object. fo:wrapper はエリアを生成しないので、 |
Q. | 改行させるために、ゼロ幅スペース(U+200B)を指定しましたが、改行されません。 [No.2003071802] |
---|---|
A. |
この問題はV2.4改訂1版までの不具合でした。 この問題はV2.5で修正されました。 |
Q. |
fo:external-graphic で content-widht="scale-to-fit" を指定したのですが、画像のサイズが変化しません。なぜですか。
[No.2003082203]
|
---|---|
A. |
"scale-to-fit" は指定された width/height に従って画像のサイズを拡縮します。width/height が指定されていない場合は画像のオリジナルサイズにて表示されます。width/height を指定してください。 |
Q. | 括弧が使用された行の、括弧の部分の文字が重なって表示/出力されることがあります。 [No.2003090508] |
---|---|
A. |
これは、XSL Formatter V2.5 の不具合でした。XSL Formatter V2.5 改訂2版にて修正されましたので、ご利用の XSL Formatter のバージョンを確認していただき、最新の XSL Formatter にアップデートしてください。 |
Q. | footnote での start-indent の継承が 他社のソフトと扱いが違っているのですが、なぜですか。 [No.2002011547] |
---|---|
A. |
これはXSL仕様に準拠しているかどうかという大きな問題です。アンテナハウスはXSL仕様を実装していますが、一方RenderXはこれを実装していないことがwebに記載されています。詳細は次をご覧ください。 > 私はアンテナハウスのFormatterは脚注が置かれるブロックからstart-indent= propertyを継承し > ていることに気が付きました。 > 一方RenderXは継承しておりません。 RenderXの"未実装"の事項です。 http://www.renderx.com/Tests/doc/html/spec.html#N4831 | XEP 2.7 には XSL1.0 Recommendation を実装していない事項が掲載されています。(以下引用文) ... | Inherited properties on <fo:footnote-body> and <fo:float> elements | In the XSL 1.0 Recommendation, <fo:footnote-body> and <fo:float> | obey to common inheritance rules. It implies that they get | inherited properties from the anchor point -- despite being | formatted into a separate area. This scheme turned out to be | extremely unpractical: footnotes/floats would inherit font | attributes from inline elements, keep-together constraints from | headings, indents from lists etc. To ensure that footnotes and | floats look uniformly in the XSL Recommendation model, a | stylesheet writer would have to care to specify an explicit | value for virtually every inhertable property on each | <fo:footnote-body>/<fo:float>. | | In this situation, we could not help sacrifying conformance to | usability. In XEP 2.7 as in previous versions of XEP, out-of-line | elements inherit properties from their ancestor <fo:flow>, thus | introducing a kind of "region-to-region" inheritance -- from | body-region to its conditional subregions. XSL仕様書によると | 5.1.4 Inheritance | ... The inheritable properties are propagated down the formatting |object tree from a parent to each child. ... 予期しない継承を防ぐためには、すべてのfo:footnote-bodyに、継承プロパテイ(start-indent="0pt" text-align="start" etc.)を指定しなければなりません。 > しかし text-decoration= inheritable property のところで、 > 子孫である<footnote-body> からは継承されないことに > 注意してください。 text-decoration は継承先プロパテイではないので、継承されません(仕様書 7.16.4 "text-decoration"を参照) |
Q. | ネストしたfo:block-containerのそれぞれにreference-orientationを指定した所、1ページに入ることを期待したいのですが2ページになってしまいました。なぜですか。 [No.2002110107] |
---|---|
A. |
質問のFOは下記のようになっています。 <fo:flow flow-name="xsl-region-body"> <fo:block> block </fo:block> <fo:block-container reference-orientation="90" > <fo:block-container reference-orientation="-90" > <fo:block> nest block-container </fo:block> </fo:block-container> </fo:block-container> </fo:flow>
つまり、reference-orientationを指定したfo:block-containerを置き、この中に再度reference-orientationを指定したfo:block-containerがあります。reference-orientationが親側のfo:block-containerにだけある場合は、1ページに'block'と'nest block-container'が収まりますが、上記のFOではそれぞれ分かれてしまい、計2ページになってしまいます。
アンテナハウスの XSL Formatter は次のように処理しています。 <fo:block-container reference-orientation="90"> この block-containerにはblock-progression-dimension も inline-progression-dimension も指定がありません。XSL Formatter ではこの場合、90度回転しているので、reference-area のblock-progression-dimension のサイズは、外側(つまりregion-body)のreference-area の inline-progression-dimension のサイズと同じになります。
<fo:block-container reference-orientation="-90"> ネストした fo:block-container が中にあるとき、このblock-containerの幅は先ほどの'仮の inline-progression-dimension' を使用してblock-containerの大きさが決まってしまいます。
解決方法は、このようにネストして回転してるような fo:block-container を使うときは必ずfo:block-container にblock-progression-dimension,inline-progression-dimension を指定してください。
XSL Formatter V2.3改訂1版までは、block-progression-dimension を比率(パーセント)で指定すると、最も近い先祖の対応寸法から計算します。このとき 参照エリアを回転させていても、block-progression-dimension, inline-progression-dimension は最も近い先祖のblock-progression-dimension, inline-progression-dimension の比率をサイズとします。
|
Q. | fo:simple-page-masterに、writing-modeプロパティで「右から左」に文字を進めるように設定したFOファイルを XSL Formatterで組版したところ、そのページマスターの内容にも writing-mode が反映されます。 XSL-FO 仕様では、simple-page-masterのwriting-modeはページの領域の位置を決定するとあり、また、フローの中のwriting-modeは、block-containerをネストしてセットすると明確に書いてあります。 従ってページマスターの内容までwriting-modeが及ぶのは仕様から肯定されないと思います。 また、fo:region-body に writing-mode を指定した場合の動作が、XSL Formatter と XEPで異なるのですが、どちらが正しいですか。 [No.2002111506] |
---|---|
A. |
XSL Formatter は仕様に準拠しています。
When "writing-mode" is applied to the simple-page-master, it is used to determine the placement of the five regions on the master. ですから、ご指摘のように writing-mode が fo:simple-page-master に指定された場合、5つのリージョン(fo:region-body,fo:region-before,fo:region-after,fo:region-start,fo:region-end)の位置に影響します。
When "writing-mode" is applied to the fo:region-*, it defines the column-progression within each region. The inline-progression-direction is used to determine the stacking direction for columns (and the default flow order of text from column-to-column). XEP では fo:region-body に writing-mode を指定した場合、region-body の column-progression-direction だけが変更され、region-body の block-progression-direction / inline-progression-direction には影響しません。
To change the "writing-mode" within an fo:flow or fo:static-content, either the fo:block-container or the fo:inline-container, as appropriate, should be used. この説明文は、fo:flow または、fo:static-content の途中で、writing-mode を fo:region-* の指定とは別のものに変更する場合のことを言っています。writing-mode のセットする方法を限定しているのではないのです。
|
Q. | FOPと XSL Formatter で、同じフォント名、フォント・サイズ、行の高さを指定して英文を組版すると行の高さが異なります。これはなぜですか。 [No.2002112205] |
---|---|
A. |
次のようなFOをXSL FormatterとFOPにて、それぞれ組版させたときに、行間幅がXSL FormatterとFOPの結果が異なってきます。 <fo:block line-height="1.5" font-size="12pt" font-family="serif"> This is a text string. This is a text string. This is a text string. </fo:block> XSL Formatterは、W3C Recommendation の 7.15.4 "line-height" XSL modifications to the CSS definition: In XSL the "line-height" property is used in determining the half-leading trait. に従い、正確な組版を行っています。これは実際に組版結果を印刷して、定規などで計れば一目瞭然です。
|
Q. | border width プロパティを指定しない時、FOP と border の幅が異なります。 [No.2003081501] |
---|---|
A. |
これは、border width のデフォルト値の違いだと思われます。
"thin" = 1pt "medium" = 3pt "thick" = 5pt これらは、組版オプションで変更することが可能です。 FOP では border width が指定されていないときに 1pt が使用されています。 同じ結果を得るためには、widthを指定するのが良いでしょう。 |