我有一个 XSL 样式表,可以通过这种方式合并外部文档
我希望 XSLT Ant 构建任务能够在文件或任何它的依赖关系发生了变化。
当前的 Ant 任务如下所示
<代码>
destdir="xxxx/dir/${doc.locale}"
包括=“*.xml”
排除=“snippets.xml”
style="build/xxxx/${doc.locale}/myStyle.xsl">
>
基本上,如果snippets.xml
文档发生更改,我想重建。
I have an XSL style sheet that merges external documents, this way
<xsl:copy-of select="document('snippets.xml')/snippets/xxxx/form"/>
I would like that the XSLT Ant build task rebuilds if the file or any of its dependencies changed.
The current Ant task looks like this
<xslt basedir="xxxx/pages/${doc.locale}"
destdir="xxxx/dir/${doc.locale}"
includes="*.xml"
excludes="snippets.xml"
style="build/xxxx/${doc.locale}/myStyle.xsl">
<param name="lang" expression="${doc.locale}"/>
<xmlcatalog refid="docDTDs"/>
Basically I would like to rebuild if the snippets.xml document is changed.
发布评论
评论(2)
Ant 具有
uptodate
任务来检查一组源文件中的目标是否是最新的、文件修改时间方面的。我不完全清楚您的依赖关系是什么,因为 XSLT 任务可以创建多个文件(导致多个目标),或者是否创建单个文件。您的评论之一暗示了一个文件。以下是使用
uptodate
的一种方法。您基本上使用该任务来设置一个属性,然后可以将其放入目标的unless
属性中:Ant has the
uptodate
task to check if a target is up-to-date, file modtime-wise, from a set of source files. I'm not completely clear on what your dependency is since the XSLT task could create multiple files (resulting in multiple targets), or if it creates a single file. One of your comments imply a single file.The following is one way to use
uptodate
. You basically use the task to set a property that can then be put in theunless
attribute of a target:默认情况下,XSLT 任务 应该为您执行此操作。它有一个可选的“force”属性
默认为 false。因此,默认情况下,除非您使用“force”属性覆盖,否则 XSLT 任务将检查依赖关系。
The XSLT task should do this for you by default. It has an optional "force" attribute
which is false by default. So by default, unless you override with the "force" attribute, dependencies are checked by the XSLT task.