2

I know in dita that one can access a keydef

<map>
    <title>variables</title>
    <keydef keys="keyName"><topicmeta><keywords><keyword>Text API</keyword></keywords></topicmeta></keydef>
</map

with a keyref statement

<keyword keyref="keyName"/>

Is it possible to access keydef from an xsl file within a dita-ot pipeline

I tried the following

  <xsl:value-of select="//keydef[@keys eq 'keyName']/topicmeta/keywords/keyword/text()"/>

and

  <xsl:value-of select="keyword[@keyref eq 'copyright']"/>

However these do not work.

Regards Conteh

conteh
  • 1,544
  • 1
  • 17
  • 39

1 Answers1

2

I used following :

<xsl:value-of select="$map/*[contains(@class,' mapgroup-d/keydef ') and lower-case(@keys) = ''keyName'']/topicmeta/keywords/keyword/node()"/>

where the $map is defined as

<xsl:variable name="map" select="//opentopic:map"/>
  • That works.. I had to add a second slash $map//* perhaps some difference in dita 2.0.1 version? – conteh Oct 06 '18 at 09:23
  • dita-ot 3.4.1: does not work... It seems that the $map does not contain the keydef elements at all. Eventually I had success with opening the original .ditamap: `document(/*/@xtrf)//keydef[@keys='keyName']/topicmeta/...` – David L. Apr 10 '20 at 08:16