Search code examples
ditaoxygenxmldita-ot

Prevent insertion of `buildId` in HTML generated by OxygenXML


I have some DITA content that I am publishing to HTML Responsive Webhelp via OxygenXML

For each export, OxygenXML appends the date-time to each import, as a buildId:

<link rel="stylesheet" type="text/css" href="../../../oxygen-webhelp/template/oxygen.css?buildId=2023042410"/>

The date-time is unique for each publishing run, and can make it appear to our Version Control System that the content has changed - though it hasn't actually.

DITA_OT does not specify the buildId when exporting to HTML - so if none of the content has changed, it's not a new version.

<link rel="stylesheet" type="text/css" href="../../../commonltr.css">

Is it possible to suppress inclusion of the buildId in HTML imports in the OxygenXML to HTML publishing process?


Solution

  • If you look in this build file "DITA-OT/plugins/com.oxygenxml.webhelp.responsive/build_dita_template.xml" there is a target named "init-whr-version" which sets up the value for this property "webhelp.transformation.timestamp".

    <target name="init-whr-version">
      <!-- WebHelp version & build number. -->
      <property name="webhelp.version" value="26.0"/>
      <property name="webhelp.build.number" value="2023080314"/>
      <echo>Oxygen XML WebHelp ${webhelp.version} build ${webhelp.build.number}</echo>
      <tstamp>
           <format property="webhelp.transformation.timestamp" pattern="yyyyMMddHHmmss"/>
        </tstamp>
    </target>
    

    I'm not sure what the elegant way to control this value would be, ideally you would not make changes inside our "com.oxygenxml.webhelp.responsive" plugin, maybe you can contact an Oxygen XML support channel (email, forum or tech support form), give them a link to this post and my colleagues from the WebHelp support team can help further.

    Forgot to give you the reason for why we do this. Web browsers cache Javascript and CSS files and if those JS and CSS files change (either you have custom WebHelp CSSs which you modify or we modify the CSSs and Javascripts between WebHelp plugin version releases) the web browser may still load the CSSs and Javascripts from older WebHelp versions thus presenting content which is not accurately displayed. So your users may at some point load the web page and see the HTML content with broken layout, this would be the danger of removing those timestamps.