Project

Profile

Help

Ant Task for Saxon: Is Source Available?

Added by Anonymous about 16 years ago

Legacy ID: #4946867 Legacy Poster: W. Eliot Kimber (drmacro)

It's not clear from the sample usage of the Saxon Ant task in the documentation if, for example, an implicit file set will be used to process a set of files and, if so, how that plays with new Transformer creation. I didn't see the source for the Ant task in the source tree in Subversion--is it there? If not, is it possible to get it? What I want is something that will directly replace this type of XSLT task as currently used in the DITA Open Toolkit: <target name="topicpull" unless="noTopic" depends="debug-filter" description="Pull metadata for link and xref element"> <xslt processor="trax" basedir="${dita.temp.dir}" destdir="${dita.temp.dir}" includes="${fullditatopiclist} ${chunkedtopiclist}" style="${dita.script.dir}${file.separator}preprocess${file.separator}topicpull.xsl"> <mapper type="glob" from="" to=".pull" /> </xslt> </target> Where the properties used on the includes= attribute are constructed by separate Toolkit-specific Java code and then loaded as Ant properties (so it wouldn't be quick to generate a Saxon-specific catalog instead). But my initial experiments suggest that the saxon-xslt task does not honor the includes= attribute. I was going to see what it would take to make that work. I also just discovered that the base Ant XSLT task has a "reloadstylesheet" property that might solve the immediate memory usage issue when using the built-in task (since the Toolkit doesn't yet use XSLT 2 I don't need the Saxon-specific version in order to specify XSLT-2-specific stuff. Thanks, Eliot


Replies (1)

RE: Ant Task for Saxon: Is Source Available? - Added by Anonymous about 16 years ago

Legacy ID: #4946894 Legacy Poster: W. Eliot Kimber (drmacro)

Actually, I'm getting strange, or at least unexpected, results from my test of the Saxon Ant task. I've got a little test project, with this Ant build task: <target name="transform" depends="init"> <saxon-xslt style="${test.dir}/xslt/add_x_to_name.xsl" destdir="${build.dir}/html" in="${test.dir}/source_docs/flattopicset/file_list.xml" > </saxon-xslt> </target> Where file_list.xml looks like this: <?xml version="1.0" encoding="UTF-8"?> <catalog stable="true"> <doc href="topic_1.xml"/> <doc href="topic_10.xml"/> <doc href="topic_100.xml"/> ... <doc href="topic_600.xml"/> </catalog> When I run it, I get this result: Buildfile: build.xml init: transform: [saxon-xslt] AntTransform.execute() schema-aware=false version 9.0.0.4 [saxon-xslt] Transforming into C:\users\ekimber\workspace\saxon-ant-test\build\html [saxon-xslt] Processing C:\users\ekimber\workspace\saxon-ant-test\build.xml to C:\users\ekimber\workspace\saxon-ant-test \build\html\build.html [saxon-xslt] Loading stylesheet C:\users\ekimber\workspace\saxon-ant-test\test\xslt\add_x_to_name.xsl [saxon-xslt] + Processing input file "file:///C:/users/ekimber/workspace/saxon-ant-test/build.xml"... [saxon-xslt] Processing C:\users\ekimber\workspace\saxon-ant-test\build\html\build.html to C:\users\ekimber\workspace\sa xon-ant-test\build\html\build\html\build.html [saxon-xslt] + Processing input file "file:///C:/users/ekimber/workspace/saxon-ant-test/build/html/build.html"... [saxon-xslt] Processing C:\users\ekimber\workspace\saxon-ant-test\build\html\build\html\build.html to C:\users\ekimber\w orkspace\saxon-ant-test\build\html\build\html\build\html\build.html [saxon-xslt] + Processing input file "file:///C:/users/ekimber/workspace/saxon-ant-test/build/html/build/html/build.htm l"... [saxon-xslt] Processing C:\users\ekimber\workspace\saxon-ant-test\build\html\build\html\build\html.classpath.html to C: \users\ekimber\workspace\saxon-ant-test\build\html\build\html\build\html\build\html.classpath.html [saxon-xslt] + Processing input file "file:///C:/users/ekimber/workspace/saxon-ant-test/build/html/build/html/build/htm l/.classpath.html"... [saxon-xslt] Processing C:\users\ekimber\workspace\saxon-ant-test\build\html\build\html\build\html.project.html to C:\u sers\ekimber\workspace\saxon-ant-test\build\html\build\html\build\html\build\html.project.html [saxon-xslt] + Processing input file "file:///C:/users/ekimber/workspace/saxon-ant-test/build/html/build/html/build/htm l/.project.html"... [saxon-xslt] Processing C:\users\ekimber\workspace\saxon-ant-test\build\html\build\html\build\html\build.html to C:\user s\ekimber\workspace\saxon-ant-test\build\html\build\html\build\html\build\html\build.html [saxon-xslt] + Processing input file "file:///C:/users/ekimber/workspace/saxon-ant-test/build/html/build/html/build/htm l/build.html"... [saxon-xslt] Processing C:\users\ekimber\workspace\saxon-ant-test\test\source_docs\flattopicset\file_list.xml to C:\user s\ekimber\workspace\saxon-ant-test\build\html\test\source_docs\flattopicset\file_list.html [saxon-xslt] + Processing input file "file:///C:/users/ekimber/workspace/saxon-ant-test/test/source_docs/flattopicset/f ile_list.xml"... [saxon-xslt] Processing C:\users\ekimber\workspace\saxon-ant-test\test\source_docs\flattopicset\map_.ditamap to C:\users \ekimber\workspace\saxon-ant-test\build\html\test\source_docs\flattopicset\map_.html [saxon-xslt] Error [saxon-xslt] java.io.FileNotFoundException: [saxon-xslt] C:\users\ekimber\workspace\saxon-ant-test\test\source_docs\flattopicset\map.dtd (The [saxon-xslt] system cannot find the file specified) [saxon-xslt] Failed to transform C:\users\ekimber\workspace\saxon-ant-test\test\source_docs\flattopicset\map_.ditamap [saxon-xslt] Failed to process C:\users\ekimber\workspace\saxon-ant-test\test\source_docs\flattopicset\file_list.xml Which seems a bit odd since it is processing everything within the directory containing the build script as well as file_list.xml (but doesn't seem to be using file_list.xml's entries to do anything). Is this user error or is something wrong? Thanks, Eliot

    (1-1/1)

    Please register to reply