Generate single html from the ditamap

Questions about XML that are not covered by the other forums should go here.
altein
Posts: 13

Generate single html from the ditamap

Thu Feb 11, 2010 12:02 am

Hi,
I noticed that when using the XHTML transformation, each topic is output in its own file. Is there a way of including a toc in every html file (i.e., in its own <div> element)?

Thanks,
Allan
Radu
Posts: 5752

Re: Generate single html from the ditamap

Thu Feb 11, 2010 10:27 am

Hi Allan,

I don't quite understand your question.
From the subject I understand that you want to generate a single XHTML document (similar to the PDF output but in the XHTML form) from the DITA project.
From the topic body I understand that you want to include a table of contents in each of the generated XHTML files.
Which one is it?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
altein
Posts: 13

Re: Generate single html from the ditamap

Fri Feb 12, 2010 2:56 pm

I apologize for the unclarity.
I wanted to know if you could generate a single XHTML document
from the ditamap, like you do when you generate a .pdf file from the ditamap.

Thanks,
Allan
Radu
Posts: 5752

Re: Generate single html from the ditamap

Fri Feb 12, 2010 3:22 pm

Hi Allan,

There is not a builtin transformation in Oxygen which does that but there is a way:
1) Edit the OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\demo\fo\build.xml file, find the target

Code: Select all

<target name="delete.fo2pdf.topic.fo" unless="retain.topic.fo">

and delete its entire content (leaving it empty). This will inhibit the DITA Open Toolkit from removing the output XSL:FO file once the PDF is constructed.

2) Run an IDIOM PDF transformation on the DITA Map.
After the transformation open in Oxygen the "topic.fo" file which will be created in the DITA transformation output folder.

3) There is a free XSLT stylesheet implementation which transforms from XSL:FO to XHTML. You can register on the RenderX website and download it:
http://www.renderx.com/tools/fo2html.html

4) Transform the FO file using the XSL stylesheet and saving the result as the HTML result.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
dagoss
Posts: 24

Re: Generate single html from the ditamap

Wed May 21, 2014 4:11 pm

While this is an older topic, I just wanted to add a better solution to this in case anyone finds it while searching for the same problem.

You can use the chuck attribute on your map to generate a single HTML file for your content:

Code: Select all

<map id="foo" chunk="to-content">
    <topicref href="test1.dita"/>
    <topicref href="test2.dita"/>
    <topicref href="test3.dita"/>
</map>


The TOC is still generated as a separate chunk, but your content will appear all on a single HTML page. Tested with Oxygen 15.2 and DITA-OT 1.7.
Radu
Posts: 5752

Re: Generate single html from the ditamap

Wed May 21, 2014 4:32 pm

Hi,

Thanks for updating this forum thread, your solution is the proper one.
I can only blame my suggested workaround at that time on the fact that back then I did not know much about DITA chunking.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “General XML Questions”

Who is online

Users browsing this forum: No registered users and 2 guests