Page 1 of 1

ant build script taking forever to convert HTML to DITA

Posted: Mon Nov 17, 2014 8:37 pm
by tomjohnson1492
I'm having trouble getting the ant script from OxygenXML to convert HTML to DITA in a timely fashion. Can you see what's happening? Here are the steps to reproduce:

1. Download this zip file: http://idratherbewriting.com/wp-content ... 11/ant.zip

2. Put the html file into this directory: [Oxygen install directory]/Applications/oxygenAuthor_161/frameworks/dita/DITA-OT/plugins/h2d

3. Open Terminal and cd to the h2d directory.

4. Type ant.

The build.xml script should run and convert the HTML file to a DITA topic. However, it takes about a minute to do this conversion. See the attached log file from my terminal. The build.xml file should convert the content almost instantly.

Why is it taking so long? For some reason, that header material is problematic. (I think if you strip it down I think the conversion is much faster.) I converted this HTML file to HTML from Pandoc. The content was originally in Markdown. I'm not sure if there's some hangup with the way Pandoc converts Markdown to HTML.

Thanks for your help.

Re: ant build script taking forever to convert HTML to DITA

Posted: Tue Nov 18, 2014 2:31 pm
by sorin_ristache
Hi Tom,

When you run the HTML to DITA conversion from a Terminal console the delay is caused by the omission of the catalog.xml file located in the same directory as the build.xml file because an XML catalog is not set explicitly in the command line task. If the HTML to DITA conversion runs as a DITA-OT plugin in the Oxygen application the catalog.xml will be taken into account because catalog.xml is registered to the DITA-OT extension point for XML catalogs:

Code: Select all

<plugin id="org.dita.specialization.h2d">
<feature extension="dita.specialization.catalog.relative"
file="catalog.xml"/>
</plugin>

Re: ant build script taking forever to convert HTML to DITA

Posted: Tue Nov 18, 2014 6:09 pm
by tomjohnson1492
Thanks. I'll experiment with that. I did find that using the Multimarkdown converter instead of Pandoc also fixes the problem.

Re: ant build script taking forever to convert HTML to DITA

Posted: Tue Nov 18, 2014 8:13 pm
by tomjohnson1492
Actually, there is a catalog.xml file in the directory I referenced. Here's the contents:

<?xml version="1.0" encoding="UTF-8"?>
<!-- This file is part of the DITA Open Toolkit project hosted on
Sourceforge.net. See the accompanying license.txt file for
applicable licenses.-->
<!--
| (C) Copyright IBM Corporation 2006. All Rights Reserved.
*-->
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
prefer="public">

<public publicId="-//W3C//DTD XHTML 1.0 Strict//EN" uri="dtd/xhtml1-strict.dtd"/>
<public publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" uri="dtd/xhtml1-transitional.dtd"/>
<public publicId="-//W3C//DTD XHTML 1.0 Frameset//EN" uri="dtd/xhtml1-frameset.dtd"/>
<public publicId="-//W3C//ENTITIES Latin 1 for XHTML//EN" uri="dtd/xhtml-lat1.ent"/>
<public publicId="-//W3C//ENTITIES Symbols for XHTML//EN" uri="dtd/xhtml-symbol.ent"/>
<public publicId="-//W3C//ENTITIES Special for XHTML//EN" uri="dtd/xhtml-special.ent"/>

</catalog>

Is there something I'm supposed to adjust to make this run faster?

Re: ant build script taking forever to convert HTML to DITA

Posted: Wed Nov 19, 2014 10:05 am
by sorin_ristache
You have to make sure the catalog.xml file is configured as an XML catalog in the ANT transformation started from a Terminal console. In the DITA transformation the catalog.xml file is configured by the h2d plugin in the DITA-OT/plugins/h2d/plugin.xml file:

Code: Select all

  <plugin id="org.dita.specialization.h2d">
<feature extension="dita.specialization.catalog.relative"
file="catalog.xml"/>
</plugin>

Re: ant build script taking forever to convert HTML to DITA

Posted: Thu Nov 20, 2014 11:11 am
by tomjohnson1492
I switched from pandoc to multimarkdown to create the HTML, and now it works fine. Here's the explanation of how I'm doing it:

http://localhost/ditaqrg/#md2html2ditav2.html

Re: ant build script taking forever to convert HTML to DITA

Posted: Thu Nov 20, 2014 2:28 pm
by sorin_ristache
Hi,

Can you post a valid URL instead of http://localhost/... ? Thank you.

Re: ant build script taking forever to convert HTML to DITA

Posted: Thu Nov 20, 2014 6:07 pm
by tomjohnson1492