2016-11-16 7 views
1

DITA-OT PDF2を使用して、FOPのインライン要素内の空白を取り除くことができません。FOPインライン要素の空白を取り除く

<xsl:attribute-set name="uicontrol"> 
    <xsl:attribute name="white-space">nowrap</xsl:attribute> 
    <xsl:attribute name="white-space-treatment">ignore</xsl:attribute> 
    <xsl:attribute name="white-space-collapse">true</xsl:attribute> 
    <xsl:attribute name="linefeed-treatment">treat-as-zero-width-space</xsl:attribute> 
    <xsl:attribute name="background-color">#ff0000</xsl:attribute> 
</xsl:attribute-set> 

すべて赤空白を剥離する必要がある。これは私の属性が設定されている

<p>1 BEFORE <uicontrol>test</uicontrol> AFTER</p> 
<p>2 BEFORE <uicontrol> test</uicontrol> AFTER</p> 
<p>3 BEFORE <uicontrol>test </uicontrol> AFTER</p> 
<p>4 BEFORE <uicontrol><keyword keyref="test"/> </uicontrol> AFTER</p> 
<p>5 BEFORE <uicontrol> <keyword keyref="test"/></uicontrol> AFTER</p> 
<p>6 BEFORE <uicontrol> 
    <keyword keyref="test"/> 
</uicontrol> AFTER</p> 
<p>7 BEFORE <uicontrol> 
    <keyword keyref="test"/> 
</uicontrol> AFTER</p> 

がにレンダリング:これは私のコードスニペットです。私のミスはどこですか?

答えて

1

FOPは、「ホワイト・スペース・治療」の難しさを持っているようだ:だから

XSL-FO Property Support Table (§7)

< XSLを使用するために必要とされ得る:ストリップ空間要素=「uicontrolの」>をプラススペースを正規化uicontrol内のtext()の関数()を呼び出します。 < XSL指定するとき

後は結果であり、次のようにストリップ空間要素を "するuicontrol" あなたの参考のために>

After applying xsl:strip-space

=、アンテナハウスは、元のスタイル定義をレンダリング:

AHF render result

希望すると、開発に役立ちます。

+0

ありがとうございました。 ''トリックをしました –

関連する問題