2017-10-30 13 views
1

私はドキュメントを持っており、リビジョンバー(マージンの黒いバー)を使って変更を追跡する必要があります。XSL-FOを使用してチェンジバーを作成する

変更されたテキストは、<span class="changeText">を使用して行われます。ブロックとセクションを扱う

<p>This is the original text. This is the original text. This is the original text. This 
is the original text. This is the original text. <span class="changeText">This text has 
changed. This text has changed. This text has changed.</span> This is the original text. 
</p> 

enter image description here

Iはもちろん

fo:block background-color="lightyellow" border-end-color="black" 
border-start-style="solid" border-start-width="4pt" padding-start="25pt" 

を用いて合理的に近づくことができ、:

例コード、下に。私はそれをインラインで動作させる必要がありますが、テキストフローをインラインに持つこの種の動作を提供する正しいコードを理解することができませんでした。

私たちの意見は高く評価されます。

ありがとうございます!

+0

ほとんどのFOプロセッサはチェンジバーをネイティブでサポートしています。これは、特にページの終わりなどに表示するほど簡単ではありません。だから最初にどのFOプロセッサーを指定する –

+0

こんにちはダニエルとケビン - 私たちは現在Apache FOPを使用しています...しかし、下のTMakitaの答えに基づいて - 私は運が尽きるかもしれないように見えます... –

答えて

1

XSL-FOではfo:change-barfo:change-bar-endを使用してリビジョンバーを実現できます。変更バー開始

https://www.w3.org/TR/xsl11/#fo_change-bar-begin

6.13.3 FO:変更バーエンド

https://www.w3.org/TR/xsl11/#fo_change-bar-end

だから、fo:change-bar-beginを生成するために必要とされる、FO

6.13.2 fo:inlineおよびfo:change-bar-end<span class="changeText">要素を一度にテンプレートなどのように:

<xsl:template match="span[string(@class) eq 'changeText']"> 
    <xsl:variable name="id" as="xs:string" select="generate-id(.)"/> 
    <fo:change-bar-begin change-bar-class="{$id}" change-bar-color="black" change-bar-style="solid"/> 
    <fo:inline background-color="yellow"> 
     <xsl:apply-templates/> 
    </fo:inline> 
    <fo:change-bar-end change-bar-class="{$id}"/> 
</xsl:template> 

サンプルの結果:これは、AHフォーマッタによって生成さ

enter image description here

。申し訳ありませんが、現在FOPではfo:change-bar-beginfo:change-bar-endが実装されていません。

関連する問題