Generate DITA XML from ... DITA XML

Here should go questions about transforming XML with XSLT and FOP.
jochemdevos
Posts: 22
Joined: Fri Feb 19, 2016 2:41 pm

Generate DITA XML from ... DITA XML

Post by jochemdevos »

Hey everyone,

Perhaps an odd question, but I would like to generate DITA files with a (book)map and a specific profiling set. The reason for this is to provide a 3rd party with DITA files without them having to look through unused profiled content. (They don't work with Oxygen).

I've found the temporary files created by a transformation scenario contain the desired DITA output, but with additional unwanted processing instructions and attributes.

Any ideas on how to achieve this?
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Generate DITA XML from ... DITA XML

Post by Radu »

Hi,

We have an action which can be used to export a DITA Map project to a ZIP file. But it does not take into account profiling condition filters. We have an issue opened for this and we'll try to increase its priority.
Oxygen has a feature which you could potentially use called XML Refactoring. If you open a DITA Map in the DITA Maps Manager view, right click the root element you can choose "Refactoring->XML Refactoring". Then you can choose a predefined operation called Delete Element and compose an XPath expression of what elements to delete based on certain profiling attributes set on them.

You should also try registering and asking around on the DITA Users List for this, I remember there was a DITA Open Toolkit plugin which could be used to obtain DITA from DITA but I cannot find a reference to it right now. But from what I remember that plugin will also generate default attributes.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jochemdevos
Posts: 22
Joined: Fri Feb 19, 2016 2:41 pm

Re: Generate DITA XML from ... DITA XML

Post by jochemdevos »

Thanks Radu, for your input.

I'll try and look around, see if I can find such a plugin.
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Generate DITA XML from ... DITA XML

Post by Radu »

Hi,

Sure, I found where that DITA OT plugin I was telling you about was:

https://github.com/dita-ot/org.dita.normalize

but it's not something bug free from what we tested.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jochemdevos
Posts: 22
Joined: Fri Feb 19, 2016 2:41 pm

Re: Generate DITA XML from ... DITA XML

Post by jochemdevos »

Radu wrote:Hi,

Sure, I found where that DITA OT plugin I was telling you about was:

https://github.com/dita-ot/org.dita.normalize

but it's not something bug free from what we tested.

Regards,
Radu
Awesome, thanks :)

I'm trying to install the plugin into Oxygen Author 17.1, following the steps described here.

The Transformation type is 'recognized' after running the OT-Integrator. Unfortunately when I run the Transformation Scenario it gives me the DOTA001F error ("dita" is not a recognized transformation type.)

What did I miss?
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Generate DITA XML from ... DITA XML

Post by Radu »

Hi,

I just tested integrating the plugin and publishing with it and it worked for me.
You should check that you are running the integrator on the same DITA OT where you placed the plugin (the integrator outputs some information in a console view). Also you should check that the DITA OT you use to publish is the same DITA OT where you installed the plugin.

Usually by default, if in Oxygen 17.1 you look in the Preferences->"DITA" page, it points to a default DITA OT distribution. If you add the plugin in that DITA OT, the available integrator transformation scenario will run in the same DITA OT. And the transformation scenario will also run with the same DITA OT, you can look at the "dita.dir" parameter when editing the transformation scenario to see what that is.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jochemdevos
Posts: 22
Joined: Fri Feb 19, 2016 2:41 pm

Re: Generate DITA XML from ... DITA XML

Post by jochemdevos »

Radu wrote:You should check that you are running the integrator on the same DITA OT where you placed the plugin (the integrator outputs some information in a console view). Also you should check that the DITA OT you use to publish is the same DITA OT where you installed the plugin.
Hey Radu,

I've ran several different custom plugins for customers, all located at:
C:\Program Files\Oxygen XML Author 17\frameworks\dita\DITA-OT\plugins

I've added the unzipped download from the link you posted, and included it in the folder mentioned above, resulting in:
C:\Program Files\Oxygen XML Author 17\frameworks\dita\DITA-OT\plugins\org.dita.normalize-master

${configured.ditaot.dir} as dita.dir parameter seems to be correct as other plugins also work fine (points to: ${frameworksDir}/dita/DITA-OT).

Output DITA OT Integrator:

Code: Select all

Executing:
"c:\program files\oxygen xml author 17\jre/bin/java" -Xmx256m -classpath "C:\Program Files\Oxygen XML Author 17\tools\ant/lib/ant-launcher.jar" "-Dant.home=C:\Program Files\Oxygen XML Author 17\tools\ant" org.apache.tools.ant.launch.Launcher -lib "C:\Program Files\Oxygen XML Author 17\frameworks\dita\DITA-OT\lib\commons-io.jar" -lib "C:\Program Files\Oxygen XML Author 17\frameworks\dita\DITA-OT2.x\lib\commons-io-2.4.jar" -f "C:\Program Files\Oxygen XML Author 17\frameworks/dita/DITA-OT/integrator.xml" "-Dstrict=true" "-Dwebhelp.trial.license=no"

Buildfile: C:\Program Files\Oxygen XML Author 17\frameworks\dita\DITA-OT\integrator.xml

strict:

integrate:

BUILD SUCCESSFUL
Total time: 1 second

The process finished with exit code: 0
(Partial) Output DITA OT Normalized DITA plugin:

Code: Select all

Executing:
"...-Ddita.dir=C:\Program Files\Oxygen XML Author 17\frameworks/dita/DITA-OT" "-DbaseJVMArgLine=-Xmx384m"

Buildfile: C:\Program Files\Oxygen XML Author 17\frameworks\dita\DITA-OT\build.xml

init:

clean-output:

BUILD FAILED
C:\Program Files\Oxygen XML Author 17\frameworks\dita\DITA-OT\build.xml:36: [DOTA001F][FATAL] "dita" is not a recognized transformation type. Supported transformation types are AMPLEXOR, Enerpac, Simcoion, Stertil, VDL, d4pjournals, docbook, eclipsecontent, eclipsehelp, epub, graphviz, html2, htmlhelp, indesign, javahelp, kindle, legacypdf, myInsight, odt, pdf, pdf-css, pdf2, reveal, rss, subjectscheme2navmap, tocjs, troff, webhelp, webhelp-feedback, webhelp-feedback-mobile, webhelp-mobile, word2dita, wordrtf, xhtml.

Total time: 0 seconds

The process finished with exit code: 1
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Generate DITA XML from ... DITA XML

Post by Radu »

Hi,

My original tests were with DITA OT 2.x.
Now I tested the plugin with DITA OT 1.8 and indeed it does not work with it, I added an issue for it + a fix suggestion that you can use on your side to get things going:

https://github.com/dita-ot/org.dita.normalize/issues/4

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jochemdevos
Posts: 22
Joined: Fri Feb 19, 2016 2:41 pm

Re: Generate DITA XML from ... DITA XML

Post by jochemdevos »

Radu wrote:Hi,

My original tests were with DITA OT 2.x.
Now I tested the plugin with DITA OT 1.8 and indeed it does not work with it, I added an issue for it + a fix suggestion that you can use on your side to get things going:

https://github.com/dita-ot/org.dita.normalize/issues/4

Regards,
Radu
Ah that explains it.

I've applied your suggested fix to the plugin and it now runs succesfully.

When viewing the output however, it only shows the dita.list and dita.xml.properties files and resources folder which is used to hold images. No DITA topics.

The temp folder does hold the DITA topics. Does it work for you? Any thoughts?

Thanks,
-Jochem
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Generate DITA XML from ... DITA XML

Post by Radu »

Hi Jochem,

You are right, although it can be made to work with DITA OT 1.8 using that fix, it does not properly work, probably it depends on a certain plugin extension which was not available in 1.8. I tested with DITA OT 2.x and it generates topics in the output folder.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jochemdevos
Posts: 22
Joined: Fri Feb 19, 2016 2:41 pm

Re: Generate DITA XML from ... DITA XML

Post by jochemdevos »

Radu wrote:Hi Jochem,

You are right, although it can be made to work with DITA OT 1.8 using that fix, it does not properly work, probably it depends on a certain plugin extension which was not available in 1.8. I tested with DITA OT 2.x and it generates topics in the output folder.

Regards,
Radu
Thanks, managed to do the same.

Going slightly off-topic here, but we're currently using DITA OT 1.8 with attribute specializations. This doesn't play nice with DITA OT 2.0, because it doesn't appear to use the 1.8 DTD.

Two questions:

1. How would I achieve dtd specialization in DITA OT 2.0? The dtd folder only holds 'properties.dtd'.
2. Do you know of any other compatibility issues when upgrading from DITA OT 1.8 to 2.0?

Thanks again!

Jochem
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Generate DITA XML from ... DITA XML

Post by Radu »

Hi Jochem,

So:
1. How would I achieve dtd specialization in DITA OT 2.0? The dtd folder only holds 'properties.dtd'
Usually a proper DITA specialization is wrapped as a DITA Open Toolkit plugin which contributes both the DTDs and the extra catalog entries to the DITA OT.
You can find such a sample plugin here:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\mathml

Once you have the specialization bundled as a plugin, you can install it in DITA OT 2.0 by copying it to its plugins folder and running the integrator.
2. Do you know of any other compatibility issues when upgrading from DITA OT 1.8 to 2.0?
Yes, there should be compatibility problems, especially if you made PDF customizations, some deprecated templates have been removed for example.
The full set of DITA OT 2.0 changes should be here:

http://www.dita-ot.org/2.0/readme/changes/rel2.0.html

So you would need to find some time to port your changes, see if they still work, maybe they do. As a best practice, you should keep an internal record of all the customization changes you make.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
jochemdevos
Posts: 22
Joined: Fri Feb 19, 2016 2:41 pm

Re: Generate DITA XML from ... DITA XML

Post by jochemdevos »

Radu wrote:Hi Jochem,

So:
1. How would I achieve dtd specialization in DITA OT 2.0? The dtd folder only holds 'properties.dtd'
Usually a proper DITA specialization is wrapped as a DITA Open Toolkit plugin which contributes both the DTDs and the extra catalog entries to the DITA OT.
You can find such a sample plugin here:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\mathml

Once you have the specialization bundled as a plugin, you can install it in DITA OT 2.0 by copying it to its plugins folder and running the integrator.
2. Do you know of any other compatibility issues when upgrading from DITA OT 1.8 to 2.0?
Yes, there should be compatibility problems, especially if you made PDF customizations, some deprecated templates have been removed for example.
The full set of DITA OT 2.0 changes should be here:

http://www.dita-ot.org/2.0/readme/changes/rel2.0.html

So you would need to find some time to port your changes, see if they still work, maybe they do. As a best practice, you should keep an internal record of all the customization changes you make.

Regards,
Radu
Hey Radu,

Our changes are fairly limited, I believe it's called attribute domain extensions, to specialize the props profiling attribute to use as profiling attributes in topics.

Hopefully I will get around to test DITA OT 2.0 compatibility with our developed PDF stylesheet soon and profiling tags, and I'll be sure to use your pointers.

Thanks for the assistence!

-Jochem
Post Reply