Hi Eliot,

Just edit the transformation scenario and in the "Advanced" tab there is a "Libraries" button. Remove the "${oxygenHome}/lib/saxon.jar" and add the Saxon 9 jars (either from the Oxygen library or from the toolkit's).
This will feed the ANT java.class.path with the libraries.
I do not know exactly what output format you are using, I will assume that you are probably using the IDIOM PDF target.
You should open the "frameworks\dita\DITA-OT\demo\fo\build.xml"
In the toolkit distributed with Oxygen the IDIOM build.xml has some patches in it for using the java class path and the Oxygen resolver. I'm attaching the patched build for DITA OT 1.4.3 which comes by default with Oxygen. You should search for "Oxygen patch" in it, particularly in the "<path id="project.class.path">" and maybe update the DITA OT 1.5 corresponding build.xml to use the patches. By default the build.xml uses hardcoded paths to the saxon libraries in the "${lib.dir}/saxon" directory and this cannot be influenced from the Oxygen scenario.

Regards,
Radu

--
Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Eliot Kimber wrote:
I'm running the Toolkit from Oxygen. I'm using the 1.5 version that I've
swapped into the base one.

I'm finding that when I run the Toolkit through Oxygen I'm getting Xalan,
not Saxon 9 when I must have XSLT 2 (and the 1.5 Toolkit includes Saxon 9 in
its dist).

I have been unable to figure out what I have to do in this scenario to make
the Ant-driven process use Saxon.

What am I missing?

Thanks,

E.
----

<?xml version="1.0"?>

<!-- 
Copyright © 2005 by Idiom Technologies, Inc. All rights reserved. 
IDIOM is a registered trademark of Idiom Technologies, Inc. and WORLDSERVER
and WORLDSTART are trademarks of Idiom Technologies, Inc. All other 
trademarks are the property of their respective owners. 

IDIOM TECHNOLOGIES, INC. IS DELIVERING THE SOFTWARE "AS IS," WITH 
ABSOLUTELY NO WARRANTIES WHATSOEVER, WHETHER EXPRESS OR IMPLIED,  AND IDIOM
TECHNOLOGIES, INC. DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
PURPOSE AND WARRANTY OF NON-INFRINGEMENT. IDIOM TECHNOLOGIES, INC. SHALL NOT
BE LIABLE FOR INDIRECT, INCIDENTAL, SPECIAL, COVER, PUNITIVE, EXEMPLARY,
RELIANCE, OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO LOSS OF 
ANTICIPATED PROFIT), ARISING FROM ANY CAUSE UNDER OR RELATED TO  OR ARISING 
OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE, EVEN IF IDIOM
TECHNOLOGIES, INC. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 

Idiom Technologies, Inc. and its licensors shall not be liable for any
damages suffered by any person as a result of using and/or modifying the
Software or its derivatives. In no event shall Idiom Technologies, Inc.'s
liability for any damages hereunder exceed the amounts received by Idiom
Technologies, Inc. as a result of this transaction.

These terms and conditions supersede the terms and conditions in any
licensing agreement to the extent that such terms and conditions conflict
with those set forth herein.
-->

<project name="dita.build"  basedir=".">

    <property name="customization.dir" value="${basedir}/Customization"/>
    <property name="ot.dir" value="${basedir}/../.."/>
    <property name="lib.dir" value="${ot.dir}/lib"/>
    <property name="fo.lib.dir" value="${basedir}/lib"/>
    <property name="xep.dir" value="${fo.lib.dir}/xep"/>
    <property name="merged.file" value="${dita.map.filename.root}_MERGED.xml" />
    <property name="document.locale" value="en_US" />

	<!-- configure FO engines -->
	<property name="pdf.formatter" value="fop"/>
	<property name="fop.home" value="${basedir}/fop"/>
	<condition property="use.xep.pdf.formatter">
		<equals arg1="${pdf.formatter}" arg2="xep"/>
	</condition>
	<condition property="use.fop.pdf.formatter">
		<not><isset property="use.xep.pdf.formatter"/></not>
	</condition>
	
    <!-- dita.temp.dir can be an absolute or relative path. Handle both. -->
    <available property="work.dir" value="${dita.temp.dir}"
        file="${dita.temp.dir}" type="dir" />
    <condition property="work.dir" value="${caller.dir}/${dita.temp.dir}">
        <not>
            <isset property="work.dir"/>
        </not>
    </condition>

    <property name="artwork.dir" value="${dita.map.output.dir}"/>
    <property name="disableRelatedLinks" value="yes"/>
    
    <condition property="file.protocol.prefix" value="file://">
        <os family="unix"/>
    </condition>

    <condition property="file.protocol.prefix" value="file:/">
        <not>
            <isset property="file.protocol.prefix"/>
        </not>
    </condition>

    <property file="${customization.dir}/build.properties"/>

    <property name="xml.catalog.files" value="${customization.dir}/catalog.xml;${basedir}/cfg/catalog.xml"/>
    
    <condition property="xep.config.file" value = "${custom.xep.config}">
        <isset property="custom.xep.config"/>
    </condition>
    <condition property="xep.config.file" value = "${xep.dir}/xep.xml">
        <not><isset property="custom.xep.config"/></not>
    </condition>

    <property name="xsl.dir" value="${basedir}/xsl"/>
    <property name="xsl.fo.dir" value="${basedir}/xsl/fo"/>
    <property name="xsl.fo.diff.dir" value="${basedir}/xsl/fo/diff"/>
    <property name="xsl.common.dir" value="${basedir}/xsl/common"/>
    <property name="cfg.dir" value="${basedir}/cfg"/>
    <property name="cfg.fo.dir" value="${basedir}/cfg/fo"/>
    <property name="cfg.common.dir" value="${basedir}/cfg/common"/>
    <property name="dtd.dir" value="${basedir}/dtd"/>
  	<!-- OXYGEN PATCH for jvmargs -->
	<property name="JVM_ARGS" value="-Xmx256m"/>

    <!-- WS runtime properties -->
    <property file="${cfg.common.dir}/properties/${document.locale}.properties"/>

    <property name="saxon.resolver.command.line" value="-w0 -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}"/>
    	<!--<fileset dir="${lib.dir}/saxon">
    	   <include name="**/*.jar"/>
    	</fileset-->

    	<!--
        <pathelement location="${lib.dir}/xml-apis.jar"/>
        <pathelement location="${lib.dir}/xercesImpl.jar"/>
        OXYGEN PATCH, use our own resolver.
        <pathelement location="${lib.dir}/resolver.jar"/>
        -->
        <pathelement location="${lib.dir}/icu4j.jar"/>        
        <pathelement location="${fo.lib.dir}/fo.jar"/>
    </path>

    <path id="xep.class.path">
	    	<!--Oxygen patch for EXM-10624, load the Oxygen patches first-->
    		<pathelement path="${java.class.path}"/>
        <fileset dir="${xep.dir}/lib" includes="**/*.jar"/>
        <pathelement location="${fo.lib.dir}/fo.jar"/>
    </path>

    <target name="preview.topic.pdf">
        <antcall target="transform.topic2pdf">
            <param name="inputFile" value="${work.dir}/${user.input.file}"/>
            <param name="outputFile" 
                value="${dita.map.output.dir}/${dita.topic.filename.root}.pdf"/>
            <param name="buildDir" value="${work.dir}"/>
            <param name="artworkPrefix" value="${artwork.dir}"/>
            <param name="xep.failOnError" value="true"/>
        </antcall>
    </target>
    
    <target name="publish.map.pdf">
    	<echo message="dita.temp.dir=${dita.temp.dir} work.dir=${work.dir}"/>
    	<echo message="dita.dir=${dita.dir}"/>
    	<echo message="basedir=${basedir}"/>
        <antcall target="transform.topic2pdf">
            <param name="inputFile" value="${work.dir}/${merged.file}"/>
            <param name="outputFile" 
                value="${dita.map.output.dir}/${dita.map.filename.root}.pdf"/>
            <param name="buildDir" value="${work.dir}"/>
            <param name="artworkPrefix" value="${artwork.dir}"/>
            <param name="xep.failOnError" value="true"/>
        </antcall>
    </target>

    <target name="transform.topic2fo">
        <taskdef classname="com.idiominc.ws.opentopic.fo.index2.IndexPreprocessorTask" name="index-preprocess"
            classpathref="project.class.path"/>
        <taskdef classname="com.idiominc.ws.opentopic.fo.i18n.PreprocessorTask" name="i18n-preprocess"
            classpathref="project.class.path"/>
        <taskdef name="dita-version" classname="com.idiominc.ws.opentopic.xsl.extension.DitaVersion"
            classpathref="project.class.path"/>

        <dita-version documentPath="${inputFile}"/>

    	<condition property="temp.transformation.file" value="${xsl.fo.dir}/topic2fo_shell_1.0.xsl">
    		<or>
	            <equals arg1="${ws.runtime.publishing.map.dita.version}" arg2="1.0"/>
	            <equals arg1="${ws.runtime.publishing.map.dita.version}" arg2="1.1"/>
	            <equals arg1="${ws.runtime.publishing.map.dita.version}" arg2="1.2"/>
			</or>
        </condition>

        <condition property="temp.transformation.file" value="${xsl.fo.dir}/topic2fo_shell.xsl">
            <not>
                <isset property="temp.transformation.file"/>
            </not>
        </condition>
    	
        <index-preprocess
            input="${inputFile}"
            output="${buildDir}/stage1.xml"
            indexConfig="${cfg.dir}/common/index/${document.locale}.xml"
            locale="${document.locale}"
            catalogs="${xml.catalog.files}">
        </index-preprocess>
        
        <!--makeurl seems to output file:/C: style instead of file:///C:, but
            xep, fop, and ah all accept it.-->
        <makeurl property="artworkPrefixUrl" file="${artworkPrefix}" />

        <!--Decide which version of saxon to use.-->
        <available classname="net.sf.saxon.Transform" property="fo.saxon.classname" value="net.sf.saxon.Transform" classpathref="project.class.path"/>
        <property name="fo.saxon.classname" value="com.icl.saxon.StyleSheet"/>
        
    	<!-- must fork or catalog resolution will fail due to sharing of -->
    	<!-- resolver and catalogs with the Open Toolkit -->
        <java classname="${fo.saxon.classname}" classpathref="project.class.path" fork="true">
    	      <!-- OXYGEN PATCH for jvmargs -->
        	  <jvmarg line="${JVM_ARGS}"/>
            <arg line='-o "${buildDir}/stage2.fo"'/>
            <arg line="${saxon.resolver.command.line}"/>
            <arg line='"${buildDir}/stage1.xml"'/>
            <arg line='"${temp.transformation.file}"'/>
            <arg line='"locale=${document.locale}"'/>
            <arg line='"customizationDir=${customization.dir}"'/>
            <arg line='"artworkPrefix=${artworkPrefixUrl}"'/>
            <arg line='"fileProtocolPrefix=${file.protocol.prefix}"'/>
            <arg line='"publishRequiredCleanup=${publish.required.cleanup}"'/>
            <arg line='"disableRelatedLinks=${disableRelatedLinks}"'/>
        	<arg line='"pdfFormatter=${pdf.formatter}"'/>
            <sysproperty key="xml.catalog.files" value="${xml.catalog.files}"/>
        </java>
                
        <condition property="i18n.config.file" 
            value="${customization.dir}/fo/i18n/${document.locale}.xml">
            <available file="${customization.dir}/fo/i18n/${document.locale}.xml"/>
        </condition>

        <condition property="i18n.config.file" 
            value="${cfg.fo.dir}/i18n/${document.locale}.xml">
            <not>
                <isset property="i18n.config.file"/>
            </not>
        </condition>

        <i18n-preprocess
            input="${buildDir}/stage2.fo"
            output="${buildDir}/stage3.fo"
            config="${i18n.config.file}"
            catalogs="${xml.catalog.files}">
        </i18n-preprocess>

        <java classname="${fo.saxon.classname}" classpathref="project.class.path" fork="true">
        	  <!-- OXYGEN PATCH for jvmargs -->
        	  <jvmarg line="${JVM_ARGS}"/>
            <arg line='-o "${outputFile}"'/>
            <arg line="${saxon.resolver.command.line}"/>
            <arg line='"${buildDir}/stage3.fo"'/>
            <arg line='"${xsl.fo.dir}/i18n-postprocess.xsl"'/>
            <sysproperty key="xml.catalog.files" value="${xml.catalog.files}"/>
        </java>
    </target>

    <target name="transform.topic2pdf">
        <antcall target="copyCoreArtwork">
            <param name="coreArtworkDestinationDir" value="${artwork.dir}"/>
        </antcall>
        
        <antcall target="transform.topic2fo">
            <param name="inputFile" value="${file.protocol.prefix}${inputFile}"/>
            <param name="outputFile" value="${dita.map.output.dir}/topic.fo"/>
            <param name="buildDir" value="${buildDir}"/>
            <param name="artworkPrefix" value="${artworkPrefix}"/>
            <param name="imageInfoFile" value="${imageInfoFile}"/>
        </antcall>

        <antcall target="transform.fo2pdf">
            <param name="inputFile" value="${dita.map.output.dir}/topic.fo"/>
            <param name="outputFile" value="${outputFile}"/>
            <param name="xep.failOnError" value="${xep.failOnError}"/>
        </antcall>

        <delete>
            <!--Deleting the stage files isn't necessary, since it will be cleaned by
                clean-temp, and is useful for debugging.-->
            <!--<fileset dir="${buildDir}" includes="stage?.*"/>-->
            <fileset dir="${dita.map.output.dir}" includes="topic.fo"/>
        </delete>
    </target>

    <target name="transform.fo2pdf">
        <antcall target="transform.fo2pdf.xep">
            <param name="inputFile" value="${dita.map.output.dir}/topic.fo"/>
            <param name="outputFile" value="${outputFile}"/>
            <param name="xep.failOnError" value="${xep.failOnError}"/>
        </antcall>
        <antcall target="transform.fo2pdf.fop">
            <param name="inputFile" value="${dita.map.output.dir}/topic.fo"/>
            <param name="outputFile" value="${outputFile}"/>
        </antcall>
    </target>
	
	<target name="transform.fo2pdf.xep" if="use.xep.pdf.formatter">
        <java classname="com.idiominc.ws.opentopic.fo.xep.Runner" 
            resultproperty="errCode" failonerror="${xep.failOnError}" 
        	fork="true">
        	  <!-- OXYGEN PATCH for jvmargs -->
        	  <jvmarg line="${JVM_ARGS}"/>

            <arg line='"${inputFile}" "${outputFile}" failOnError=${xep.failOnError}'/>
            <classpath refid="xep.class.path"/>
            <sysproperty key="com.renderx.xep.CONFIG" value="${xep.config.file}"/>
        </java>
        <condition property="xepExitedOnError" value="true">
          <not>
             <equals arg1="${errCode}" arg2="0"/>
          </not>
        </condition>
	</target>
	

	 <target name="transform.fo2pdf.fop" if="use.fop.pdf.formatter">
	        <!-- OXYGEN PATCH Run the FOP as an external process -->
	        <java classname="org.apache.fop.cli.Main" fork="yes" classpath="${java.class.path}" dir="${dita.map.output.dir}">
	         <!-- OXYGEN PATCH for jvmargs -->
	         <jvmarg line="${JVM_ARGS}"/>
	            <arg line='-fo "${inputFile}" -pdf "${outputFile}" -c "${fop.home}/conf/fop.xconf"'/>
	        </java>
	 </target> 
	
    <target name="copyCoreArtwork">
        <copy todir="${coreArtworkDestinationDir}/Configuration/OpenTopic"
            failonerror="false">
            <fileset dir="${basedir}" includes="cfg/common/artwork/**/*.*"/>
        </copy>
        <copy todir="${coreArtworkDestinationDir}/Customization/OpenTopic" 
            failonerror="false">
            <fileset dir="${customization.dir}" includes="common/artwork/**/*.*"/>
        </copy>
    </target>    

</project>
_______________________________________________
oXygen-user mailing list
[email protected]
http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Reply via email to