Transformation-Szenario DITA-XML

Here should go questions about transforming XML with XSLT and FOP.
forummarcel
Posts: 24
Joined: Wed Feb 13, 2013 9:54 am

Transformation-Szenario DITA-XML

Post by forummarcel »

Hello Everyone

Just started to look into DITA some weeks back. Since i can't use a regular output scenario such as i.e. PDF or XHTML, i am wondering how i could establish the following:

The content of my .dita-Files should be written into a final overall XML-File, according to the order that is given in the ditamap for further processing. My catalog consists only of some modular files containing only a few simple tags. It is majorly the modularity and reuse capability why i think that DITA is a good approach to my problem.

How could i achieve this as easy as possible?

Thanks for your help.
marcel
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transformation-Szenario DITA-XML

Post by Radu »

Hi Marcel,

I do not quite understand your entire use case.
So you do not actually want to publish to PDF, XHTML, so on, you just want a special output format, right?
If you open the DITA Map in the DITA Maps Manager view and you edit the DITA MAP PDF transformation scenario, you can set in the Parameters list the parameter called clean.temp to no.
Then after running the scenario, in the temporary files folder you should find a file called something like yourMapFileName_MERGED.xml.
That merged file is probably close to what you want, it contains the DITA Map with the topic references expanded in-place.

Or you can apply some XSLT processing on the DITA Map to achieve this.
We have some XSLs used to report certain metrics in a DITA Map from which a part can be used for this.
If you create an XSLT file in:

OXYGEN_INSTALL_DIR/frameworks/dita/report/expand.xsl

with the following content:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:oxyd="http://www.oxygenxml.com/ns/dita">

<xsl:import href="modules/resolve.xsl"/>
<xsl:output indent="yes"/>

<xsl:template match="/">
<!-- Get the DITA map and all its content in a resolved document -->
<oxyd:mapref xml:base="{document-uri(.)}">
<xsl:apply-templates select="/" mode="resolve"/>
</oxyd:mapref>
</xsl:template>
</xsl:stylesheet>
and you transform the DITA Map with it using the Saxon 9 PE XSLT processor you should receive the map with all topic refs resolved in place.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
forummarcel
Posts: 24
Joined: Wed Feb 13, 2013 9:54 am

Re: Transformation-Szenario DITA-XML

Post by forummarcel »

Hi Radu, thanks very much for your advise and very quick answer. Yes, i think that might be exactly what i want. What i need is in the end: a final, complete xml-file, representing the complete and final content of a particular print product. This XML-file involves then only the content connected to the necessary tags required for our print purposes, and will then be imported straight into our indesign templates, which have all the necessary formats and layouts pre-defined in place.

My question was only of preliminary nature, since i am evaluating possible publication scenarios for our technical manuals. So unfortunately at this stage i can't test your inputs, however it looks very promising. Thanks a lot.
Marcel
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transformation-Szenario DITA-XML

Post by Radu »

Hi Marcel,

Oxygen uses the DITA Open Toolkit for publishing.
There is a free set of DITA Open Toolkit called DITA For Publishers which has a plugin for DITA to Indesign:

http://dita4publishers.sourceforge.net/d4p-user-guide/

So maybe you just need to try and install the D4P plugins in the DITA OT bundled with Oxygen:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT

and it might do what you want.

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