1

我有兴趣输出围绕所有 fo:blocks 的纯黑色边框,以帮助查看边界在 pdf 输出中显示的元素之间的位置。

我想在应用边框的 dita-ot 插件末尾应用一个转换。我可以摆弄以下 xsl,但是我不确定如何在 dita-ot 进程结束时应用 xlst。

    <?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet exclude-result-prefixes="xs ditaarch opentopic e" version="2.0" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" xmlns:e="com.docdept.pdf" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:opentopic="http://www.idiominc.com/opentopic" xmlns:opentopic-func="http://www.idiominc.com/opentopic/exsl/function" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


        <xsl:template match="@*|*|processing-instruction()|comment()">
            <xsl:copy>
                <xsl:apply-templates select="*|@*|text()|processing-instruction()|comment()"/>
            </xsl:copy>
        </xsl:template>



    <xsl:template match="fo:block">
        <xsl:copy>
        <xsl:copy-of select="@*"/>

            <xsl:attribute name="border-style">solid</xsl:attribute>
            <xsl:attribute name="border-width">0.5pt</xsl:attribute>
            <xsl:attribute name="border-color">black</xsl:attribute>
            <xsl:apply-templates select="*"/>

        </xsl:copy>
    </xsl:template>

</xsl:stylesheet>

我想也许在流程结束时应用wireframe.xsl,但这不起作用。

<?xml version='1.0' encoding='UTF-8'?>
<plugin id="com.docdept.pdf">
  <require plugin="org.dita.pdf2" />
  <feature extension="dita.conductor.transtype.check" value="adjust-pdf" />
  <feature extension="dita.transtype.print" value="docdept-pdf" />
  <feature extension="dita.conductor.target.relative" file="integrator.xml" />
  <feature extension="dita.xsl.pdf" file="xsl/fo/wireframe.xsl"/>
</plugin>
4

1 回答 1

1

我看到最好将不同颜色的边框与属性集相关联,这样在 fo 输出中也可以通过颜色名称搜索视觉参考。

<xsl:attribute name="border">1mm thin solid</xsl:attribute>
<xsl:attribute name="border-color">GOLD</xsl:attribute>
于 2018-10-04T10:14:21.507 回答