我们可以在DITA OT 1.8.5中的XHTML插件中复制特定的目录和文件吗?

时间:2017-02-06 09:27:55

标签: xml xhtml dita oxygenxml dita-ot

以下是我尝试过的代码,

将文件夹和文件从XHTML插件 - reource文件夹复制到XHTML DITA-OT转换创建的输出位置。

的plugin.xml

<plugin id="com.example.extendchunk">
  <feature extension="depend.preprocess.post" value="copyfiles"/>
  <feature extension="dita.conductor.target.relative" file="myAntStuffWrapper.xml"/>
</plugin> 

myAntStuffWrapper.xml

<dummy>
  <import file="myAntStuff.xml"/>
</dummy>

myAntStuff.xml

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="myAntStuff">
  <target name="copyfiles">
    <copy todir="foo">
      <fileset>
        <include name="**/*.bar"/>
      </fileset>
    </copy>
  </target>
</project>

使用此功能,我们需要将多个文件和文件夹复制到输出位置。 I.E. (C:\ DITA-OT1.8.5 \ plugins \ org.dita.xhtml \ resource)到输出位置(E:\ task \ out \ xmthl) - 由XHTML DITA OT转换创建。

请解释我如何指定以下标签。

<copy todir="foo">
and
<include name="**/*.bar"/>

1 个答案:

答案 0 :(得分:0)

这适用于标准DITA Open Toolkit输出目录,它使用由OT创建的变量${output.dir}

<copy todir="${output.dir}">

对于从您提到的资源目录进行复制,它将是这样的:

<include name="${dita.plugin.org.dita.xhtml.dir}/resource/*"/>

但是,当您运行xhtml转换时,可能已经复制了该目录的内容。直接修改OT附带的org.dita.xhtml插件的文件不是最佳做法,即使您可能使其工作。相反,您应该创建自己的单独插件来调用org.dita.xhtml插件,然后使用插件中的文件覆盖它。在这种情况下,您将以类似的方式从插件中复制:

<include name="${dita.plugin.mycompany.xhtml.dir}/resource/*"/>

但这不是你的问题。有关学习如何创建自己的插件的信息,请参阅此参考资料:

http://www.dita-ot.org/1.8/dev_ref/plugins-overview.html

如果这个答案是正确的,请将其标记为正确,以便得到我的积分,谢谢。