Trying to add support for new output type for highlight plugin.

Post here questions and problems related to editing and publishing DITA content.
easirois
Posts: 11
Joined: Thu Feb 04, 2010 10:37 pm

Trying to add support for new output type for highlight plugin.

Post by easirois »

Hi,
I'm trying to add support for a new output type for the syntax highlighting plugin but running into an issue getting the template to be executed and essentially, trying to emulate the PDF portion to support Miramo. I have started with copying the pdfHighlight.xsl as the basis of the customization.

The issue is with the use-when part. The same template definition is used in both cases. It works on the FO side, but not the Miramo side.
<xsl:template match="*[contains(@class,' pr-d/codeblock ')][contains(@outputclass, 'language-') or @outputclass=$allConfigHighlights]" use-when="function-available('version:getProductVersion') or function-available('oxy:highlight')">

Looking at the integration with the fop shell file I only see this: <xsl:import xmlns:dita="http://dita-ot.sourceforge.net" href="plugin:com.oxygenxml.highlight:pdfHighlight.xsl"/>. If I put that same reference in the Miramo shell, then the template above is not executed as well. If I remove the use-when bit from the template, then the template is executed.

So the big question is what am I missing with respect to the two functions? Where are they defined?
easirois
Posts: 11
Joined: Thu Feb 04, 2010 10:37 pm

Re: Trying to add support for new output type for highlight plugin.

Post by easirois »

I'm using a custom version of DITA OT 3.7.4. Trying to debug with editor 25.1.
easirois
Posts: 11
Joined: Thu Feb 04, 2010 10:37 pm

Re: Trying to add support for new output type for highlight plugin.

Post by easirois »

Looks looks like I found the issue.

In order for an <xslt> process in the Ant files to pick up the classpath information from the main build file it needs to be wrapped inside a pipeline element. Once that happens, then I'm getting the proper template called in the xslt.
<pipeline>
<xslt/>
</pipeline>
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Trying to add support for new output type for highlight plugin.

Post by Radu »

Hi Eric,
Right, thanks for posting the solution. By the way the "com.oxygenxml.highlight" plugin is not open source, so copying parts of it is Ok to help maybe a particular common customer for their internal needs but copies of its content should not be released in an open source plugin.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply