ditaoxygenxmldita-ot

Generate linebreak in DITA content


I have some content in DITA which I am exporting to HTML both via the DITA-OT tool and OxygenXML.

To aid readability of the content the authors would like to provide line-breaks. They are used to doing this in HTML, but I'm currently unable to offer them a DITA solution.

I have read about support for the <?linebreak?> processing instruction in the LwDITA plug-in, but it doesn't seem to work for the plugins I am using.

Is there another way of inserting a line-break in a chunk of DITA text?


Solution

  • If I take a stock installation of OxygenXML 26 and use the default DITA to HTML publishing the <?linebreak?> processing instruction in a DITA XML file should translate automatically to a <br> in the published HTML output. Oxygen 26 uses the DITA Open Toolkit version 4.1.2.

    Maybe you can download DITA OT 4.1.2 from the DITA OT web site and look inside the "org.lwdita" plugin to see how the "linebreak" handling works. Basically the "plugin.xml" refers to a "xsl/linebreak2html5.xsl" XSLT stylesheet which matches the processing instruction and replaces it with <br>

    https://github.com/jelovirt/org.lwdita/blob/master/src/main/plugin.xml https://github.com/jelovirt/org.lwdita/blob/master/src/main/resources/linebreak2html5.xsl

    So even if you are using some custom DITA Open Toolkit you could create your own DITA OT plugin which adds an XSLT stylesheet handling such a processing instruction.