syntax highlight plugin detailed in help

Here should go questions about transforming XML with XSLT and FOP.
JeffR
Posts: 7
Joined: Thu Mar 13, 2014 4:23 pm

syntax highlight plugin detailed in help

Post by JeffR »

I tried to install the code highlighter made available here:
http://www.oxygenxml.com/doc/ug-editor/ ... lugin.html

I created a folder C:\Program Files\Oxygen XML Author 15\frameworks\dita\DITA-OT\plugins\com.oxygenxml.highlight

I created a file inside called plugin.xml with the following content:

Code: Select all

plugin id="com.oxygenxml.highlight">
<feature extension="package.support.name" value="Oxygen XML Editor Support"/>
<feature extension="package.support.email" value="support@oxygenxml.com"/>
<feature extension="package.version" value="1.0.0"/>
<feature extension="dita.xsl.xhtml" value="xhtmlHighlight.xsl" type="file"/>
<feature extension="dita.xsl.xslfo" value="pdfHighlight.xsl" type="file"/>
</plugin>

a second file called xhtmlHighlight.xsl with the following content:

Code: Select all

<xsl:template match="*[contains(@class,' topic/pre ')]" name="topic.pre">
<!-- This template is deprecated in DITA-OT 1.7. Processing will moved into the main element rule. -->
<xsl:if test="contains(@frame,'top')"><hr /></xsl:if>
<xsl:apply-templates select="*[contains(@class,' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
<xsl:call-template name="spec-title-nospace"/>
<pre>
<xsl:attribute name="class"><xsl:value-of select="name()"/></xsl:attribute>
<xsl:call-template name="commonattributes"/>
<xsl:call-template name="setscale"/>
<xsl:call-template name="setidaname"/>
<!--Here I'm calling the styler of the content inside the codeblock.-->
<xsl:call-template name="outputStyling"/>
</pre>
<xsl:apply-templates select="*[contains(@class,' ditaot-d/ditaval-endprop ')]" mode="out-of-line"/>
<xsl:if test="contains(@frame,'bot')"><hr /></xsl:if><xsl:value-of select="$newline"/>
</xsl:template>
I ran the Integrator.

When I run any webhelp xform I get the error message:

Code: Select all

[xslt] C:\Program Files\Oxygen XML Author 15\frameworks\dita\DITA-OT\plugins\com.oxygenxml.highlight\xhtmlHighlight.xsl:1:74: Fatal Error! Error reported by XML parser Cause: org.xml.sax.SAXParseException; systemId: file:/C:/Program%20Files/Oxygen%20XML%20Author%2015/frameworks/dita/DITA-OT/plugins/com.oxygenxml.highlight/xhtmlHighlight.xsl; lineNumber: 1; columnNumber: 74; The prefix "xsl" for element "xsl:template" is not bound.

I have little XSLT experience but I thought this looked pretty straightforward?

Is xhtmlHighlight.xsl missing a line with a declaration of some kind???
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: syntax highlight plugin detailed in help

Post by Radu »

Hi Jeff,

You are probably using Oxygen 15.0 or 15.1.
Actually I wrote the user manual topic you mentioned in your forum post while I was working to create this plugin and bundle it with Oxygen 15.2.

In Oxygen 15.2 (which you can download and install from our web site) we added this plugin out of the box to the DITA OT bundled with Oxygen.
So if you use the default Oxygen 15.2 transformations and mark your codeblock sections with proper outputclass values:

http://www.oxygenxml.com/doc/ug-oxygen/ ... block.html

you will get syntax highlight in your DITA code block sections.
If you want to look at the plugin's resources, they are available in:

OXYGEN_15_2_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\com.oxygenxml.highlight

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
JeffR
Posts: 7
Joined: Thu Mar 13, 2014 4:23 pm

Re: syntax highlight plugin detailed in help

Post by JeffR »

I'm up and running!

Thanks for the quick response.

The support you folks provide is consistently excellent.
Post Reply