DITA OT transformation scenarios in Oxygen

Post here questions and problems related to editing and publishing DITA content.
Gahr
Posts: 4
Joined: Fri Mar 04, 2022 11:23 am

DITA OT transformation scenarios in Oxygen

Post by Gahr »

Hi,

I am not sure I fully understand how DITA OT transformation scenarios are working.
I have a client using 10 custom plugins (custom dtd, several for PDFs and for HTML5 output).
They have a custom plugin named something like com.customer.html5 and a custom transtype for HTML5, and when selecting this one, it is expected that their customizations do apply.
However, when selecting the DITA OT 3.3.4 default HTML5 transformation scenario , several of their customizations do still apply, while in my understanding it should output "vanilla" HTML5.
Furthermore, modifying one of their XSL inside the client HTML5 plugin has a direct impact when using default HTML5 transformation scenario, which I don't get either.
Could this be related to them using their own custom DTD (I do not think so but ...) ?
Could you shed some light on the way transtypes and transformation works inside Oxygen?

Thanks a lot,
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: DITA OT transformation scenarios in Oxygen

Post by Radu »

Hi,

It depends on what extension points that custom plugin implements in its "plugin.xml" configuration file. Maybe you can paste here in a code block the entire contents of the custom plugin's plugin.xml.
For example this plugin:
https://github.com/oxygenxml/dita-media ... plugin.xml
implements this extension point:

Code: Select all

<feature extension="dita.xsl.html5" value="xhtmlMedia.xsl" type="file"/>
meaning that it will be applied for the HTML5 transformation and for any other transformation which extends it.
All DITA Open Toolkit plugin extension points are documented here:
https://www.dita-ot.org/dev/extension-p ... oints.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Gahr
Posts: 4
Joined: Fri Mar 04, 2022 11:23 am

Re: DITA OT transformation scenarios in Oxygen

Post by Gahr »

Hi Radu,
Thank you for your feedback.

The plugin.xml is the following:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="dita-ot/plugin.rnc" type="application/relax-ng-compact-syntax"?>
<plugin id="com.customer.html5">
    <transtype name="customer-html5" extends="html5" desc="Customer HTML5 output"/>
    <feature extension="ant.import" file="build_dita2customer-html5.xml"/>
    <feature extension="dita.xsl.html5" file="xsl/dita2customer-html5.xsl"/>
</plugin>
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: DITA OT transformation scenarios in Oxygen

Post by Radu »

Hi,

So as I mentioned, this extension point implementation in the custom plugin.xml:

Code: Select all

<feature extension="dita.xsl.html5" file="xsl/dita2customer-html5.xsl"/>
is applied to the base HTML5 plugin and to any plugin extending the base HTML5 plugin. So it affects any plain DITA to HTML5 publishing.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Gahr
Posts: 4
Joined: Fri Mar 04, 2022 11:23 am

Re: DITA OT transformation scenarios in Oxygen

Post by Gahr »

Thank you Radu, that is much more clear.
Then my question is, in that case what purpose does the Transtype serve if the extension points is affecting even the base HTML5 scenario ?
In the case of my client, do not see differences between the 2 output scenarios (default HTML5 and customer HTML5) for the same map.
gbv34
Posts: 105
Joined: Thu Jan 20, 2022 12:36 pm

Re: DITA OT transformation scenarios in Oxygen

Post by gbv34 »

Hi Radu!
Let me jump in because I'm interested in this question too.

When selecting a standard HTML5 transformation scenario in Oxygen, is there any way to get an output not affected by the declarations that were made in a custom HTML5 plugin? Because what I understand now is that the custom HTML5 plugin is reliant on the baseHTML5 plugin. That's fine.
However, I don't get why the base HTML5 plugin is reliant on the custom HTML5 plugin when selecting a standard HTML5 scenario.
------
Gaspard
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: DITA OT transformation scenarios in Oxygen

Post by chrispitude »

Hi gbv34, Gahr,

When a custom plugin makes use of DITA-OT HTML5 extension points:

https://www.dita-ot.org/3.7/extension-p ... html5.html

then the XSLT/parameter files for that plugin are literally installed into the DITA-OT processing files themselves. For example, if you look in your DITA-OT directory, you will see these two files:

Code: Select all

<DITA-OT>/plugins/org.dita.html5/xsl/dita2html5Impl_template.xsl
<DITA-OT>/plugins/org.dita.html5/xsl/dita2html5Impl.xsl
The "template" version of the file is not actually used for processing. Instead, it contains this line:

Code: Select all

<dita:extension id="dita.xsl.html5"
      behavior="org.dita.dost.platform.ImportXSLAction"
      xmlns:dita="http://dita-ot.sourceforge.net"/>
which is a placeholder for where plugin-provided XSLT files are included. The non-"template" version of the file is the one actually used for DITA-OT processing, and it has the placeholder replaced with includes of the actual XSLT files contributed by custom plugins for that extension point:

Code: Select all

<xsl:import href="plugin:com.synopsys.html5:html5.xsl"/>
This placeholder replacement is done by the dita install command. Other DITA-OT extension points (preprocessing, other transformation types, etc.) work similarly with their own "template"/actual file pairs.

So plugins don't really turn on and off; instead, their files are statically incorporated into whatever DITA-OT processing files are indicated by the extension points.

Although plugins are statically installed into the DITA-OT processing files, they can still turn their functionality on and off by looking at parameters, defining their own transformation types, and other similar mechanisms.
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: DITA OT transformation scenarios in Oxygen

Post by Radu »

Hi,

About the last posed questions:
However, I don't get why the base HTML5 plugin is reliant on the custom HTML5 plugin when selecting a standard HTML5 scenario.
I think Chris' answer covers this, plugins are not isolated, an extension point implemented by a plugin influences all other plugins which use it.
When selecting a standard HTML5 transformation scenario in Oxygen, is there any way to get an output not affected by the declarations that were made in a custom HTML5 plugin?
Yes, sure, so your plugin.xml looks like this:

Code: Select all

<plugin id="com.customer.html5">
    <transtype name="customer-html5" extends="html5" desc="Customer HTML5 output"/>
    <feature extension="ant.import" file="build_dita2customer-html5.xml"/>
    <feature extension="dita.xsl.html5" file="xsl/dita2customer-html5.xsl"/>
</plugin>
You need to remove this line from it:

Code: Select all

<feature extension="dita.xsl.html5" file="xsl/dita2customer-html5.xsl"/>
Then inside your custom build_dita2customer-html5.xml build file you need to do something like what's done in this plugin:

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

It has an XSLT stylesheet which imports the base HTML5 xslt stylesheet:
https://github.com/dita-ot/org.dita-ot. ... a2html.xsl
and in the build file it defines an args.xsl parameter which points to its own XSLT stylesheet:
https://github.com/dita-ot/org.dita-ot. ... t.html.xml

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
gbv34
Posts: 105
Joined: Thu Jan 20, 2022 12:36 pm

Re: DITA OT transformation scenarios in Oxygen

Post by gbv34 »

Thanks Chris and Radu for your insightful answers.
------
Gaspard
Post Reply