Printing @importance="optional" for more than steps

Here should go questions about transforming XML with XSLT and FOP.
dgallo
Posts: 78

Printing @importance="optional" for more than steps

Fri Apr 21, 2017 5:53 pm

We are using the attribute @importance="optional" on more than just step elements, therefore we need the word "Optional" to print whenever it is used. Currently the word "Optional" only prints when it is used for steps.

I need it to work for both HTML and PDF output.
bogdan_cercelaru
Posts: 188

Re: Printing @importance="optional" for more than steps

Mon Apr 24, 2017 3:56 pm

Hello,

I've tested by setting the @importance="optional" attribute on a paragraph in a DITA topic but this attribute is not passed in the generated output.
As a workaround, you could use the outputclass attribute, with a custom value (for example, @outputclass="optional") and a custom CSS:

Code: Select all

*[class*="optional"]:before{
    display: inline-block;
    content: "Optional:";
    font-weight: bold;
    padding-right: .5em
}

To use a custom CSS you have to set the "args.copycss" parameter to "yes" and the "args.css" to point to your custom CSS file.

Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
dgallo
Posts: 78

Re: Printing @importance="optional" for more than steps

Mon Apr 24, 2017 10:47 pm

Is there another way of doing this without having to use an outputclass? Can the important attribute be updated to have word phrases be printed out when used on more than just step elements?
Radu
Posts: 5088

Re: Printing @importance="optional" for more than steps

Mon May 01, 2017 9:37 pm

Hi,

Right now the @importance attribute doe not seem to be used very much in the publishing engine.
Possibly my creating an XSLT customization for the HTML output, matching a certain DITA element you could use the value of the attribute and set a certain attribute to the corresponding HTML element but there is no such builtin capability.

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

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest