Debugging custom plugin XSL?? Please help

Post here questions and problems related to editing and publishing DITA content.
Posts: 30
Joined: Wed Aug 16, 2017 8:07 pm

Debugging custom plugin XSL?? Please help

Post by kgajda »

I am working on creating a new custom plugin for my company's webhelp to bring us current, and one of the other extensions that we reply on is another custom one that was built in-house, but the author didn't leave their name in the manifest and we have no idea who created it. It is essentially for equation and figure numbering, and it is not working. It looks like the weak link has been traced to the one file inside of it, the xsl file, dita2htmllmpl.xsl, but I have no idea 1) how to figure out what is valid and what is not and 2) if there is an error if the whole thing shuts down, since it is xml. The googles haven't helped me.
Can anyone answer either of those questions?
I am attaching the actual XSL, too, if that helps.
(1.64 KiB) Downloaded 19 times
The part that should kick in here starts at line40, as it used to produce <equation-figure> tags in html, though the error may be anywhere, theoretically, I guess if that could throw off the whole file from working?
Thank you a thousand times over for any help or direction. Trying to decipher this XSL hurts my brain and I don't know how to debug, especially if one error throws off the whole file.
Posts: 8736
Joined: Fri Jul 09, 2004 5:18 pm

Re: Debugging custom plugin XSL?? Please help

Post by Radu »

Hi Kim,
So how is the "dita2htmlImpl.xsl" file used in your WebHelp plugin?
To see if it is used at all, maybe you can make it not wellformed (remove a "<" from it for example), publish and see if the publishing fails with an error stating that it can no longer process the XSLTs.
So you have this XSLT template in your custom XSLT:

Code: Select all

<xsl:template match="*[contains(@class, ' topic/fig ') and contains(@class, ' equation-d/equation-figure ')]" name="topic.fig.equation">
Your XSLT template seems to specially match DITA <equation-figure> elements, is this corrrect?
It seems to produce in the output HTML an element named "<equation-figure>" but this does not make sense as there are no "<equation-figure>" elements in the HTML vocabulary so the web browser does not know how to handle such elements. You can open in Oxygen the resulting HTML topics, do they contain inside "<equation-figure>" tags?
I would have expected the xsl template to produce some kind of HTML <div> element for the DITA <equation-figure> element. So this does not make sense to me.
It's hard to debug and understand what someone intended to do with an XSLT customization.

Radu Coravu
<oXygen/> XML Editor
Post Reply