Is there a plugin to show profiling attributes?

zuza
Posts: 13
Joined: Fri May 13, 2016 5:34 pm

Is there a plugin to show profiling attributes?

Post by zuza » Wed Jul 03, 2019 3:47 pm

Hi,

I am interested in a plugin for publishing to PDF that would show the profiling attributes. That would be very useful when sending PDFs for review.

Is there such a plugin, or is there a plan to create such a plugin?


I am currently using flagging, but it requires extra work for creating the ditaval files and adding rules such as:

<prop action="flag" att="audience" val="INTERNAL" color="green">
<startflag>
<alt-text>INTERNAL</alt-text>
</startflag>
<endflag>
<alt-text>/INTERNAL</alt-text>
</endflag>
</prop>


Unfortunately we have hundreds of possible features and tens of products.

Also this kind of flagging doesn't change the colour of the text inside tables or for anything using the "title" style.


Many thanks,
Ozana

Radu
Posts: 6552
Joined: Fri Jul 09, 2004 5:18 pm

Re: Is there a plugin to show profiling attributes?

Post by Radu » Thu Jul 04, 2019 11:48 am

Hi Ozana,

Usually all profiling attributes and their values are removed from the XML content after the filtering stage.
But if in the DITAVAL file you write stuff like this:

Code: Select all

<prop action="passthrough" att="audience"/>
the attribute and its value should be preserved for later usage.

There are two ways to obtain PDF from DITA with Oxygen, using CSS or using XSL-FO.
With XSL-FO, for each DITA element there is an equivalent xsl:template which outputs the equivalent xsl:fo element. Somehow after each of those xsl:fo elements an extra xsl:fo inline element would need to be emitted containing the attribute name and value. I'm not sure how this can be practically done without modifying all the xsl:templates.
For the CSS-based approach, possibly a custom CSS like this could work (but I have not tried this):

Code: Select all

*[data-audience]{
 border: 1px solid blue;
}
*[data-audience]:after{
 content: attr(data-audience);
 border: 1px solid blue;
}
If you are interested in the CSS-based approach I could try to look more into this myself and make it work on my side.

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

zuza
Posts: 13
Joined: Fri May 13, 2016 5:34 pm

Re: Is there a plugin to show profiling attributes?

Post by zuza » Tue Aug 13, 2019 1:28 pm

Hi Radu,

I would be interested in the CSS approach for Webhelp Responsive, if that is possible.

Our PDFs are generated with XSL-FO (using the Apache FOP). I am not that good with xsl, but I was wondering if it would be possible to:
  • have a pre-processing stage where each audience/product/otherprops/props attribute generates an outputclass for that element, for example:

    Code: Select all

    <p product="A" audience="INTERNAL">Some text. </p>
    gets converted into:

    Code: Select all

    <p outputclass="product-A audience-INTERNAL" product="A" audience="INTERNAL">Some text. </p>
  • have an xsl template that wraps all element templates and looks for this kind of outputclass and then flags the element based on the outputclass, something like this:
    [product=A, audience=INTERNAL]
    Some text .
    [/product=A, /audience=INTERNAL]
If that wouldn't work, I will try to come with other crazy ideas :-)

Thank you.

Best regards,
Ozana

Radu
Posts: 6552
Joined: Fri Jul 09, 2004 5:18 pm

Re: Is there a plugin to show profiling attributes?

Post by Radu » Wed Aug 21, 2019 4:24 pm

Hi Ozana,

Sorry for the delay.
For any kind of output, by default profiling attributes get removed in the pre-processing stages of the publishing engine. So you will still need a DITAVAL filter file to specify pass-through for all profiling attributes like:

Code: Select all

<prop action="passthrough" att="audience"/>
after this the HTML5 output will contain the attributes converted to HTML "data-" attributes which can be matched in the CSS.

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

Post Reply