Page 1 of 1

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

Posted: Fri Aug 17, 2018 3:19 am
by mdslup
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?

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

Posted: Fri Aug 17, 2018 7:30 am
by Radu
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

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

Posted: Wed Aug 22, 2018 12:34 am
by mdslup
Great, that $DEFAULTLANG is exactly what I needed! Thanks.

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

Posted: Wed Aug 22, 2018 12:35 am
by mdslup
By the way is there a mapping of transformation variables to XSLT variables somewhere that I could look at?

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

Posted: Wed Aug 22, 2018 8:11 am
by Radu
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