Pass language explicitly to "getVariable" template
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Pass language explicitly to "getVariable" template
Post by Frank Ralf »
Hello,
I have created a customization of the Oxygen WebHelp. One of the XSLT templates matches <xsl:template match="toc:topic>. Inside this template I use <xsl:call-template name="getVariable"> for some localized text. The problem is that somehow no language values seems to be available inside this template so the default language is alway used for localization.
I'm thinking about passing the desired language code explicitly to "getVariable". I've already looked at the code for "getVariable" and "findString" in DITA-OT\xsl\common\dita-utilities.xsl as well as for <xsl:function name="dita-ot:get-variable"> in DITA-OT\xsl\common\functions.xsl but I have no idea how to achieve this.
Any pointers welcome.
Best regards,
Frank
I have created a customization of the Oxygen WebHelp. One of the XSLT templates matches <xsl:template match="toc:topic>. Inside this template I use <xsl:call-template name="getVariable"> for some localized text. The problem is that somehow no language values seems to be available inside this template so the default language is alway used for localization.
I'm thinking about passing the desired language code explicitly to "getVariable". I've already looked at the code for "getVariable" and "findString" in DITA-OT\xsl\common\dita-utilities.xsl as well as for <xsl:function name="dita-ot:get-variable"> in DITA-OT\xsl\common\functions.xsl but I have no idea how to achieve this.
Any pointers welcome.
Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: Pass language explicitly to "getVariable" template
Post by Frank Ralf »
Found this related issue in the DITA-OT tracker with some hints how to solve my problem:
Bug in "dita-utilities.xsl" getVariable when called from string context
https://github.com/dita-ot/dita-ot/issues/2512
Frank
Bug in "dita-utilities.xsl" getVariable when called from string context
https://github.com/dita-ot/dita-ot/issues/2512
Best regards,From any context, I think this would provide a mechanism to override the language, by passing in something like <node xml:lang="fi"/> (though I'm not sure how useful this would be outside of a test scenario).
...
I also tried calling this while passing in a node to reset the context - this retrieved a Russian string, and would work from any context (string context or anything else):
<xsl:with-param name="ctx" as="node()"><dummy xml:lang="ru"/></xsl:with-param>
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service