Webhelp classic, modfying XSL - can I case off of profiling attributes or transform parameters?

mdslup
Posts: 110
Joined: Tue Mar 06, 2018 1:34 am

Webhelp classic, modfying XSL - can I case off of profiling attributes or transform parameters?

Post by mdslup » Fri Aug 17, 2018 3:19 am

Oxygen 20.0. I'm modifying some of the XSL for the webhelp classic transformation (my favorite transformation scenario, it's so good, please don't remove it!).

I'd like to create an if statement that is dependent on one or both of the following:

* The transformation scenario parameters (such as args.default.language).
* The Oxygen profiling attributes (such as when I run a scenario with audience="EU").

Is this possible? If so, how do I do it?

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

Re: Webhelp classic, modfying XSL - can I case off of profiling attributes or transform parameters?

Post by Radu » Fri Aug 17, 2018 7:30 am

Hi,

So:
The transformation scenario parameters (such as args.default.language).
The args.default.language ANT parameter should be passed to an XSLT parameter called $DEFAULTLANG which you can try to use in your XSLT.
* The Oxygen profiling attributes (such as when I run a scenario with audience="EU").
Usually the profiling attributes are filtered out before the XSLT is applied but you can create a DITAVAL file having the contents like this:

Code: Select all

<val>
<prop action="passthrough" att="audience"/>
</val>
and use it in the transformation scenario in the "Filters" tab.
After this, you should probably be able to match the attribute in the XSLT. The profiling attribute will also be passed to the output HTML document as a "data-audience" attribute set on the element.

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

mdslup
Posts: 110
Joined: Tue Mar 06, 2018 1:34 am

Re: Webhelp classic, modfying XSL - can I case off of profiling attributes or transform parameters?

Post by mdslup » Wed Aug 22, 2018 12:34 am

Great, that $DEFAULTLANG is exactly what I needed! Thanks.

mdslup
Posts: 110
Joined: Tue Mar 06, 2018 1:34 am

Re: Webhelp classic, modfying XSL - can I case off of profiling attributes or transform parameters?

Post by mdslup » Wed Aug 22, 2018 12:35 am

By the way is there a mapping of transformation variables to XSLT variables somewhere that I could look at?

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

Re: Webhelp classic, modfying XSL - can I case off of profiling attributes or transform parameters?

Post by Radu » Wed Aug 22, 2018 8:11 am

Hi,

There is no such list of ANT param to XSLT param mappings. I had to search through "DITA-OT2.x/plugins/com.oxygenxml.webhelp.responsive/build_dita_template.xml" to see how the "args.default.language" is used.
Why did you need this information in your XSLT code? If you wanted to translate a certain static text depending on the language you should have called a predefined template called "getVariable" with a certain ID like:

Code: Select all

          <xsl:call-template name="getVariable">
<xsl:with-param name="id" select="'Related concepts'"/>
</xsl:call-template>
and then provide internationalization for that ID:

https://www.oxygenxml.com/doc/versions/ ... nsive.html

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

Post Reply