--
You received this message because you are subscribed to the Google Groups "DITA-OT Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "DITA-OT Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I was looking into this last week and the logic seems to be:
* Current language (for generated text) is determined with the named template getLowerCaseLang
* PDF imports the common code xsl/common/dita-utilities.xsl which has that function, returning the current language based on context
* But, PDF overrides that in org.dita.pdf2/xsl/common/vars.xsl to use the default locale, set by parameter - meaning that regardless of context, it returns the locale parameter
* To override PDF so that it works the same as XHTML (returning language of closest ancestor), I created a plugin that just copies the original template from dita-utilities. Not a lot of code, but it means I've copied code [A] to override code [B] which overrides code [A].
To get this working, I just created a plugin that extends dita.xsl.xslfo with the following stylesheet - taking the original code from dita-utilities.xsl
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet
version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="getLowerCaseLang">
<xsl:variable name="ancestorlangUpper">
<xsl:choose>
<xsl:when test="ancestor-or-self::*/@xml:lang">
<xsl:value-of select="ancestor-or-self::*[@xml:lang][1]/@xml:lang"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$DEFAULTLANG"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="lower-case($ancestorlangUpper)"/>
</xsl:template>
</xsl:stylesheet>
I'd kind of like to see this as a configurable option, so that I don't need to extend it. Every multi-lang PDF I've worked with should get generated text from the closest element, rather than from the document, but the current behavior has been around so long that I'm reluctant to just change it.
Robert D Anderson
IBM Authoring Tools Development
Chief Architect, DITA Open Toolkit (http://www.dita-ot.org/)Frank Ralf ---09/28/2015 02:07:56---Hi Kendall, Many thanks for this background information and the pointers. I will have
--
You received this message because you are subscribed to the Google Groups "DITA-OT Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
dita-ot-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.