Help with Ant error

38 views
Skip to first unread message

Joe Williams

unread,
Apr 27, 2017, 9:41:51 AM4/27/17
to DITA-OT Users, dita-...@googlegroups.com
Posted this to the Yahoo DITA user group and didn't get much response. I am interested in knowing why this error occurs (i.e., what is actually going on or NOT going on under the covers) as much as how to correct it and get my build working.

We are upgrading from DITA-OT1.6 to 2.4.5 and migrating plugins and build files and so on, and I have hit a snag with an XSLT Ant task that we have been running as part of a TOCJS build for months with no problems.

        <xslt in="${args.input}" style="${resources}/getFigs.xsl"
            out="${resources}/figures.txt">
        </xslt>
The build fails, with java.io.FileNotFoundException: C:\repos\ICW-OT-upgrade\ICW_TTWCS_GUI-build-245\source\scciLearningMap.dtd (The system cannot find the file specified).

The input file is a specialized map with the following declaration:
<!DOCTYPE map PUBLIC "urn:pubid:teamscci.com:doctypes:icw:scciLearningMap" "scciLearningMap.dtd">

Looks like Ant/Saxon is not using the catalog file.

I tried adding an xmlcatalog element, but that did not work either, though I may have had the syntax wrong. I added this after the properties in the build file:

  <xmlcatalog id="dita.catalog">
    <catalogpath path="${dita.plugin.org.dita.base.dir}/catalog-dita.xml"/>
  </xmlcatalog>
  
  And added this in the <xslt> task itself:
  <xmlcatalog refid="dita.catalog"/>

Any idea what is going on here?

Stefan Eike

unread,
Apr 27, 2017, 10:15:58 AM4/27/17
to DITA-OT Users, dita-...@googlegroups.com
Hi Joe,

you don't need to add a new catalog element. Just do:


<xslt in="${args.input}"
    style="${resources}/getFigs.xsl"
    out="${resources}/figures.txt">
    <xmlcatalog refid="dita.catalog"/>
</xslt>

This should work.

Cheers,
Stefan

Joe Williams

unread,
Apr 27, 2017, 10:26:17 AM4/27/17
to Stefan Eike, DITA-OT Users, dita-...@googlegroups.com
Thanks for the fast reply, Stefan, but I tried that first and it did not work. Someone else suggested making sure resolver.jar is in the lib directory with Saxon, and it is (latest versions of both).

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stefan Eike

unread,
Apr 27, 2017, 11:07:18 AM4/27/17
to DITA-OT Users, s.ei...@gmail.com, dita-...@googlegroups.com
Hi Joe,

hmm..., maybe you should try the Ant <java> task. Please post the log, if possible.

<java classname="net.sf.saxon.Transform">
    <classpath>
        <fileset dir="${dita.dir}/lib">
            <include name="**/*.jar" />
        </fileset>
    </classpath>
    <arg value="-s:${args.input}"/>
    <arg value="-o:${resources}/figures.txt"/>
    <arg value="-xsl:${resources}/getFigs.
xsl"/>
</java>


Greetings,
Stefan

Joe Williams

unread,
Apr 27, 2017, 11:16:45 AM4/27/17
to Stefan Eike, DITA-OT Users, dita-...@googlegroups.com
Basically the same thing: Not using the catalog, it looks like to me. If I delete the DOCTYPE declaration from the map the build does not fail, but of course it does not do anything, either.

Here is the error message.
     [java] Error
     [java]   java.io.FileNotFoundException:
     [java]   C:\repos\ICW-OT-upgrade\ICW_TTWCS_GUI-build-245\source\scciLearningMap.dtd (The system
     [java]   cannot find the file specified)
     [java] Transformation failed: Run-time errors were reported
     [java] Java Result: 2

BTW: Using Java 1.8, DITA-OT 2.4.5

Joe Williams

unread,
Apr 27, 2017, 5:58:54 PM4/27/17
to Stefan Eike, DITA-OT Users, dita-...@googlegroups.com
I will just leave this here so I or someone else can find it.

    <target name="getFigs">
        <xmlcatalog id="ditaCatalog">
            <catalogpath>
                <fileset dir="${dita.dir}" includes="**/catalog.xml"/>
                <fileset dir="${dita.dir}" includes="**/catalog-dita.xml"/>
            </catalogpath>
        </xmlcatalog>
        <xslt in="${args.input.dir}/${args.input}" style="${resources}/getFigs.xsl"
            out="${resources}/figures.txt">
            <xmlcatalog refid="ditaCatalog"/>
        </xslt>
    </target>
Reply all
Reply to author
Forward
0 new messages