WEB Help customization problem - ${webhelp.fragment.after.body}

Post here questions and problems related to editing and publishing DITA content.
tmakita
Posts: 100
Joined: Fri Apr 08, 2011 7:58 am

WEB Help customization problem - ${webhelp.fragment.after.body}

Post by tmakita »

Hi,

I have a request from users to customize WEB help to add back to top button in all of the generated HTML files. I examined how to solve this effectively seeing the WEB Help stylesheet.

In the examination process I found the ant parameter ${webhelp.fragment.after.body}. It seems very useful because I can directly insert the intended HTML fragment into the target HTML.

plugin_commons.xml

Code: Select all

    <param name="webhelp.fragment.after.body"
desc="Specifies the path to the HTML file that contains the content to be included at the end of the html 'body' element of the WebHelp pages. It can also be an XML fragment."
type="file">
<val default="true"></val>
</param>
But the relevant XSLT stylesheet has following codes:

commonComponentsExpander.xsl line 651 or near

Code: Select all

                <xsl:variable name="toIncludeSequence">
<xsl:choose>
<xsl:when test="$toIncludeDoc/*:html/*:body">
<xsl:copy-of select="$toIncludeDoc/*:html/*:body[1]"/>
</xsl:when>
<xsl:when test="$toIncludeDoc//*:body">
<xsl:copy-of select="$toIncludeDoc//*:body[1]"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$toIncludeDoc"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
This code copies body element to the target HTML. As a result nested body/body element are generated. It is meaningless. The child nodes of the body should be inserted before the end of the body element.

So I think this portion should be following:

Code: Select all

                <xsl:variable name="toIncludeSequence">
<xsl:choose>
<xsl:when test="$toIncludeDoc/*:html/*:body">
<xsl:copy-of select="$toIncludeDoc/*:html/*:body[1]/node()"/>
</xsl:when>
<xsl:when test="$toIncludeDoc//*:body">
<xsl:copy-of select="$toIncludeDoc//*:body[1]/node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$toIncludeDoc"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Could you kindly give me your opinion?

Regards,

--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: WEB Help customization problem - ${webhelp.fragment.after.body}

Post by radu_pisoi »

Hi,

Thank you for reporting this issue.

Yes, you are right. You have discovered an issue in the XSLT code used to inject external code in the WebHelp output. This problem was already solved in our development code and a fix will be included in the next oXygen version.
Could you kindly give me your opinion?
Meanwhile, the single solution that you have is to modify the WebHelp stylesheets because latest released WebHelp does not support extensions to override the XSLT code. The next WebHelp version will include an extension mechanism allowing you to override XSLT stylesheets too.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
tmakita
Posts: 100
Joined: Fri Apr 08, 2011 7:58 am

Re: WEB Help customization problem - ${webhelp.fragment.after.body}

Post by tmakita »

Hi Radu,

Thank you for your quick reply.
The next WebHelp version will include an extension mechanism allowing you to override XSLT stylesheets too.
It's great! I will wait for the next version.

Regards,
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
Post Reply