Re: Strings and Variables - which are used where? #DITA-OT #HTML #PDF


vicmortelmans@...
 

Note to self: custom texts can have parametrized parts, e.g.:

<variable id="Body odd footer"><param ref-name="documentnumber"/>&#xA0;<param ref-name="buildlanguage"/>&#xA0;<param ref-name="builddate"/></variable>

You fill them in when calling "getVariable" by providing "params", like this:

                <xsl:call-template name="getVariable">
                    <xsl:with-param name="id" select="'Body odd footer'"/>
                    <xsl:with-param name="params">
                      <documentnumber>
                        <fo:inline>documentnumber
                          <xsl:value-of select="//*[contains(@class, ' topic/othermeta ') and @name='documentnumber']/@content"/>
                        </fo:inline>
                      </documentnumber>
                      <buildlanguage>
                        <fo:inline>buildlanguage
                          <xsl:value-of select="$buildParameterLanguage"/>
                        </fo:inline>
                      </buildlanguage>
                      <builddate>builddate
                        <fo:inline>
                          <xsl:value-of select="document($revisedDate)/reviseddate/@modified"/>
                        </fo:inline>
                      </builddate>
                    </xsl:with-param>
                </xsl:call-template>

This does however NOT work, when the custom text is defined as a <str> element, e.g.:

    <str name="Body even footer"><param ref-name="documentnumber"/>&#xA0;<param ref-name="buildlanguage"/>&#xA0;<param ref-name="builddate"/></str>

Here the parametrized fields will be left out, whatever you provide as "params" when calling "getVariable".

I've found no documentation on this so far. Maybe someone more knowledgeable can confirm that these assumptions (based on experience) are true?

Best regards,
Vic

Join main@dita-users.groups.io to automatically receive all group messages.