Page 1 of 1

Is there a plugin to show profiling attributes?

Posted: Wed Jul 03, 2019 3:47 pm
by zuza
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

Re: Is there a plugin to show profiling attributes?

Posted: Thu Jul 04, 2019 11:48 am
by Radu
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

Re: Is there a plugin to show profiling attributes?

Posted: Tue Aug 13, 2019 1:28 pm
by zuza
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

Re: Is there a plugin to show profiling attributes?

Posted: Wed Aug 21, 2019 4:24 pm
by Radu
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

Re: Is there a plugin to show profiling attributes?

Posted: Fri Oct 14, 2022 11:18 am
by julien_lacour
Hello,

Oxygen 25.0 is now available! In this new version if you are generating PDFs using the DITA Map PDF - based on HTML5 & CSS transformation scenario you can use the args.css.param.show-profiling-attributes parameter in order to display the profiling attributes names and values in the output.

Regards,
Julien