Track change support in DITAPDF output

Here should go questions about transforming XML with XSLT and FOP.
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Track change support in DITAPDF output

Post by mu258770 »

Hi Team,

We would like to support track changes in the PDF output generated from the source DITA files edited in oxygen. I have read the threads below,

post32282.html#p32282
but could not find a proper solution.
I have seen the reply as ,
Implementing such a plugin would be quite complicated. We use processing instructions to mark changes and comments and for example comments can start in any place of the document and end in any place of the document, so that the content between the start and end processing instructions is not necessarily wellformed so you cannot wrap all the content between the start and end processing instructions in a single HTML or XSL-FO element and match that element in the output to have a certain style.
This is the issue we are facing. When we try to handle displaying track changes in output, the output is not getting generated at times because of the problem with well-formedness. Could you please let us know whether you have any solution for this.

Thank you!

Regards,
Shabeer
Radu
Posts: 9056
Joined: Fri Jul 09, 2004 5:18 pm

Re: Track change support in DITAPDF output

Post by Radu »

Hi Shabeer,

How exactly did you try to implement this? As a DITA Open Toolkit plugin?
Usually it's impossible to output not-wellformed XML using an XSLT stylesheet.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Re: Track change support in DITAPDF output

Post by mu258770 »

Hi Radu,

Yes, as a DITA open toolkit plugin using XSL-FO coding. We tried to handle the track changes display in the output by using <fo:inline color="blue"> when <?oxy_insert_start> is found and closing the element (</fo:inline>) once <?oxy_insert_end> is found. But in different contexts this doesn't work as the starting and ending of track changes markup can be anywhere in the input(causing well-formedness issue in output). This is causing the fo output generation failure.

Please let us know whether you have any solution or suggestion for this.

Thank you!

Regards,
Shabeer
Radu
Posts: 9056
Joined: Fri Jul 09, 2004 5:18 pm

Re: Track change support in DITAPDF output

Post by Radu »

Hi Shabeer,

We have something similar implemented for the DITA to PDF output using CSS and the commercial Prince XML engine, plugin which is located in:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT2.x\plugins\com.oxygenxml.pdf.css

You can open one of the XSLT stylesheets used there:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT2.x\plugins\com.oxygenxml.pdf.css\xsl\review\review-pis-to-elements.xsl

and look into it.
Basically the stylesheet matches any text node:

Code: Select all

<xsl:template match="text()" priority="100">
and then tries to surround them by using fo:inline elements if the text node is between oxy_insert start and end PIs.
Also the stylesheet tries to expand oxy_delete PIs.

So you could use that stylesheet as a possible example.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Re: Track change support in DITAPDF output

Post by mu258770 »

Hi Radu,

It worked perfect for us :)

Thanks a lot for your quick help!

Regards,
Shabeer
mu258770
Posts: 157
Joined: Mon Aug 18, 2014 4:11 pm

Re: Track change support in DITAPDF output

Post by mu258770 »

Hi team,

I have been testing oXygen 18 feature for track change support in PDF output. I could see some fault in it.

When I delete a complete table keeping track change ON and I generate the PDF output keeping the track change option, the output is not coming proper. It should just show the complete <table> with the styling of red strike out in output. Instead, it is showing the source tags with red strike out.

Could you please look into the same.

Regards,
Shabeer
Radu
Posts: 9056
Joined: Fri Jul 09, 2004 5:18 pm

Re: Track change support in DITAPDF output

Post by Radu »

Hi Shabeer,

The PDF publishing with change tracking right now does not preserve the structure of the deleted content, so indeed the deleted content is shown as serialized XML with a strike out line.
I added an issue for it:

https://github.com/oxygenxml/dita-class ... w/issues/2

but there are technical difficulties doing this from the XSLT so we might now be able to implement this.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply