From: Jakub Adam <jakub.adam@ktknet.cz>
Date: Sat, 10 Dec 2011 23:24:51 +0100
Subject: distribution-saxon-compat

---
 demo/fo/build_template.xml |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/demo/fo/build_template.xml b/demo/fo/build_template.xml
index d1d07dd..3b18fd2 100644
--- a/demo/fo/build_template.xml
+++ b/demo/fo/build_template.xml
@@ -71,7 +71,7 @@ with those set forth herein.
     <property name="dtd.dir" value="${dita.plugin.org.dita.pdf2.dir}/dtd"/>
     
     <property name="saxon.resolver.command.line"
-      value="-warnings:silent -x:org.apache.xml.resolver.tools.ResolvingXMLReader -y:org.apache.xml.resolver.tools.ResolvingXMLReader -r:org.apache.xml.resolver.tools.CatalogResolver"/>
+      value="-x org.apache.xml.resolver.tools.ResolvingXMLReader -y org.apache.xml.resolver.tools.ResolvingXMLReader -r org.apache.xml.resolver.tools.CatalogResolver"/>
     
     <path id="project.class.path">
       <pathelement path="${java.class.path}"/>
@@ -209,6 +209,25 @@ with those set forth herein.
     <condition property="temp.transformation.file" value="${xsl.fo.dir}/topic2fo_shell${formatter.specific.ext}.xsl">
       <not><isset property="temp.transformation.file"/></not>
     </condition>
+
+    <property name="args.bookmark.style.arg" value=""/>
+    <property name="args.chapter.layout.arg" value=""/>
+    <property name="args.fo.include.rellinks.arg" value=""/>
+    <property name="args.gen.task.lbl.arg" value=""/>
+    <condition property="args.bookmark.style.arg" value="antArgsBookmarkStyle=">
+        <not><equals arg1="${args.bookmark.style}" arg2=""/></not>
+    </condition>
+    <condition property="args.chapter.layout.arg" value="antArgsChapterLayout=">
+        <not><equals arg1="${args.chapter.layout}" arg2=""/></not>
+    </condition>
+    <condition property="args.fo.include.rellinks.arg" value="antArgsIncludeRelatedLinks=">
+        <not><equals arg1="${args.fo.include.rellinks}" arg2=""/></not>
+    </condition>
+    <condition property="args.gen.task.lbl.arg" value="antArgsGenerateTaskLabels=">
+        <not><equals arg1="${args.gen.task.lbl}" arg2=""/></not>
+    </condition>
+    <property name="saxon.props" value="${args.bookmark.style.arg}${args.bookmark.style} ${args.chapter.layout.arg}${args.chapter.layout} ${args.fo.include.rellinks.arg}${args.fo.include.rellinks} ${args.gen.task.lbl.arg}${args.gen.task.lbl}"/>
+
   </target>
 
   <target name="transform.topic2fo.index">
@@ -287,7 +306,7 @@ with those set forth herein.
     <java classname="${fo.saxon.classname}" classpathref="project.class.path" fork="true"
           maxmemory="${maxJavaMemory}">
       <jvmarg line="${baseJVMArgLine}"/>
-      <arg line='-o:"${dita.temp.dir}/stage2.fo"'/>
+      <arg line='-o "${dita.temp.dir}/stage2.fo"'/>
       <arg line="${saxon.resolver.command.line}"/>
       <arg line='"${dita.temp.dir}/stage1a.xml"'/>
       <arg line='"${temp.transformation.file}"'/>
@@ -300,10 +319,7 @@ with those set forth herein.
       <arg line='"fileProtocolPrefix=${file.protocol.prefix}"'/>
       <arg line='"publishRequiredCleanup=${publish.required.cleanup}"'/>
       <arg line='"disableRelatedLinks=${disableRelatedLinks}"'/>
-      <arg line='"antArgsBookmarkStyle=${args.bookmark.style}"'/>
-      <arg line='"antArgsChapterLayout=${args.chapter.layout}"'/>
-      <arg line='"antArgsIncludeRelatedLinks=${args.fo.include.rellinks}"'/>
-      <arg line='"antArgsGenerateTaskLabels=${args.gen.task.lbl}"'/>
+      <arg line='${saxon.props}'/>
       <arg line='"pdfFormatter=${pdf.formatter}"'/>
       <sysproperty key="xml.catalog.files" value="${xml.catalog.files}"/>
     </java>
-- 
