fo:change-bar-begin 不是 fo:inline fop 1.1 的 child
fo:change-bar-begin is not a child of fo:inline fop 1.1
我正在使用 FOP 1.1 并尝试使用 fo:change-bar-begin,但出现以下错误:
org.apache.fop.fo.ValidationException: "fo:change-bar-begin" 不是 "fo:inline" 的有效 child!
根据 W3C Recommandation,change-bar-begin 和 change-bar-end 定义 "points" 并且可以作为 fo:flow 或 fo:static 的后代在任何地方使用-内容,基本上在任何 fo:block 或 fo:inline.
示例代码:
<fo:block background-color="Tomato" text-indent="-57.5pt" start-indent="57.5pt">
<fo:inline background-color="aquamarine" font-size="10" font-family="Arial, sans-serif">1.</fo:inline>
<fo:change-bar-begin change-bar-offset="2mm" change-bar-color="red" change-bar-style="solid" change-bar-class="cc01"/>
<fo:inline background-color="LightSteelBlue" keep-with-previous="always" font-size="10" font-family="Arial, sans-serif" padding-left="48.39pt">Remove panel.</fo:inline>
<fo:change-bar-end change-bar-class="cc01"/>
</fo:block>
我做错了什么?
谢谢!
弗罗林
我觉得没问题,关于 fo:change-bar-begin
作为 fo:flow
或 fo:static-content
的后代被允许在任何地方的说法是正确的。所以这看起来像是一个 FOP 错误。
在您的示例中,fo:change-bar-begin
实际上不是 fo:inline
的子代。您是否尝试将更改栏 FO 放在 fo:inline
中?
FWIW,在 https://www.antennahouse.com/antenna1/comprehensive-xsl-fo-tutorials-and-samples-collection/ 的 "Comprehensive XSL-FO Tutorials and Samples Collection" 中有一个格式化的更改栏示例。
我正在使用 FOP 1.1 并尝试使用 fo:change-bar-begin,但出现以下错误:
org.apache.fop.fo.ValidationException: "fo:change-bar-begin" 不是 "fo:inline" 的有效 child!
根据 W3C Recommandation,change-bar-begin 和 change-bar-end 定义 "points" 并且可以作为 fo:flow 或 fo:static 的后代在任何地方使用-内容,基本上在任何 fo:block 或 fo:inline.
示例代码:
<fo:block background-color="Tomato" text-indent="-57.5pt" start-indent="57.5pt">
<fo:inline background-color="aquamarine" font-size="10" font-family="Arial, sans-serif">1.</fo:inline>
<fo:change-bar-begin change-bar-offset="2mm" change-bar-color="red" change-bar-style="solid" change-bar-class="cc01"/>
<fo:inline background-color="LightSteelBlue" keep-with-previous="always" font-size="10" font-family="Arial, sans-serif" padding-left="48.39pt">Remove panel.</fo:inline>
<fo:change-bar-end change-bar-class="cc01"/>
</fo:block>
我做错了什么?
谢谢!
弗罗林
我觉得没问题,关于 fo:change-bar-begin
作为 fo:flow
或 fo:static-content
的后代被允许在任何地方的说法是正确的。所以这看起来像是一个 FOP 错误。
在您的示例中,fo:change-bar-begin
实际上不是 fo:inline
的子代。您是否尝试将更改栏 FO 放在 fo:inline
中?
FWIW,在 https://www.antennahouse.com/antenna1/comprehensive-xsl-fo-tutorials-and-samples-collection/ 的 "Comprehensive XSL-FO Tutorials and Samples Collection" 中有一个格式化的更改栏示例。