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

mdslup
Posts: 75

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

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: 5813

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

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: 75

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

Wed Aug 22, 2018 12:34 am

Great, that $DEFAULTLANG is exactly what I needed! Thanks.
mdslup
Posts: 75

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

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: 5813

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

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/20.1/ug-editor/topics/localize-webhelp-responsive.html

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

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 5 guests