Showing:

Documentation
Parameters
Used by
References
Supersedes
Included from
Source
Stylesheet rel-links.xsl
Documentation

Description

 This file is part of the DITA Open Toolkit project hosted on 
     Sourceforge.net. See the accompanying license.txt file for 
     applicable licenses.
 (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved. 
Included from
Template *add-link-highlight-at-start
Documentation
Namespace No namespace
Match *
Mode add-link-highlight-at-start
Import precedence 4
Source
Template *add-link-highlight-at-end
Namespace No namespace
Match *
Mode add-link-highlight-at-end
Import precedence 4
Source
Template *add-xref-highlight-at-start
Namespace No namespace
Match *
Mode add-xref-highlight-at-start
Import precedence 4
Source
<xsl:template match="*" mode="add-xref-highlight-at-start"/>
Template *add-xref-highlight-at-end
Namespace No namespace
Match *
Mode add-xref-highlight-at-end
Import precedence 4
Source
<xsl:template match="*" mode="add-xref-highlight-at-end"/>
Template *add-custom-link-attributes
Documentation
Namespace No namespace
Match *
Mode add-custom-link-attributes
Import precedence 4
Source
Template *{http://dita-ot.sourceforge.net/ns/200709/related-links}ordered.child.prefix
Documentation
Namespace No namespace
Match *
Mode {http://dita-ot.sourceforge.net/ns/200709/related-links}ordered.child.prefix
Import precedence 4
Source
Template *{http://dita-ot.sourceforge.net/ns/200709/related-links}unordered.child.prefix
Namespace No namespace
Match *
Mode {http://dita-ot.sourceforge.net/ns/200709/related-links}unordered.child.prefix
Import precedence 4
Source
Template *[contains(@class,' topic/xref ')]topic.xref
Documentation

Description

 ========== End hooks for common user customizations ========== 
template for xref
Namespace No namespace
Match *[contains(@class,' topic/xref ')]
Mode #default
References
Import precedence 4
Source
<xsl:template match="*[contains(@class,' topic/xref ')]" name="topic.xref">
  <xsl:variable name="flagrules">
    <xsl:call-template name="getrules"/>
  </xsl:variable>
  <xsl:call-template name="start-flags-and-rev">
    <xsl:with-param name="flagrules" select="$flagrules"/>
  </xsl:call-template>
  <xsl:choose>
    <xsl:when test="@href and normalize-space(@href)!=''">
      <xsl:apply-templates select="." mode="add-xref-highlight-at-start"/>
      <a>
        <xsl:call-template name="commonattributes"/>
        <xsl:apply-templates select="." mode="add-linking-attributes"/>
        <xsl:apply-templates select="." mode="add-desc-as-hoverhelp"/>
        <!-- if there is text or sub element other than desc, apply templates to them
          otherwise, use the href as the value of link text. -->
        <xsl:choose>
          <xsl:when test="@type='fn'">
            <sup>
              <xsl:choose>
                <xsl:when test="*[not(contains(@class,' topic/desc '))]|text()">
                  <xsl:apply-templates select="*[not(contains(@class,' topic/desc '))]|text()"/>
                  <!--use xref content-->
                </xsl:when>
                <xsl:otherwise>
                  <xsl:call-template name="href"/>
                  <!--use href text-->
                </xsl:otherwise>
              </xsl:choose>
            </sup>
          </xsl:when>
          <xsl:otherwise>
            <xsl:choose>
              <xsl:when test="*[not(contains(@class,' topic/desc '))]|text()">
                <xsl:apply-templates select="*[not(contains(@class,' topic/desc '))]|text()"/>
                <!--use xref content-->
              </xsl:when>
              <xsl:otherwise>
                <xsl:call-template name="href"/>
                <!--use href text-->
              </xsl:otherwise>
            </xsl:choose>
          </xsl:otherwise>
        </xsl:choose>
      </a>
      <xsl:apply-templates select="." mode="add-xref-highlight-at-end"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:apply-templates select="*|text()|comment()|processing-instruction()"/>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:call-template name="end-flags-and-rev">
    <xsl:with-param name="flagrules" select="$flagrules"/>
  </xsl:call-template>
</xsl:template>
Template *[contains(@class,' topic/related-links ')]breadcrumb
Documentation

Description

create breadcrumbs for each grouping of ancestor links; include previous, next, and ancestor links, sorted by linkpool/related-links parent. If there is more than one linkpool that contains ancestors, multiple breadcrumb trails will be generated
Namespace No namespace
Match *[contains(@class,' topic/related-links ')]
Mode breadcrumb
References
Variable newline
Import precedence 4
Source
<xsl:template match="*[contains(@class,' topic/related-links ')]" mode="breadcrumb">
  <xsl:for-each select="descendant-or-self::*[contains(@class,' topic/related-links ') or contains(@class,' topic/linkpool ')][child::*[@role='ancestor']]">
    <xsl:value-of select="$newline"/>
    <div class="breadcrumb">
      <xsl:choose>
        <!--output previous link first, if it exists-->
        <xsl:when test="*[@href][@role='previous']">
          <xsl:apply-templates select="*[@href][@role='previous'][1]" mode="breadcrumb"/>
        </xsl:when>
        <xsl:otherwise/>
      </xsl:choose>
      <!--if both previous and next links exist, output a separator bar-->
      <xsl:if test="*[@href][@role='next'] and *[@href][@role='previous']">
        <xsl:text> | </xsl:text>
      </xsl:if>
      <xsl:choose>
        <!--output next link, if it exists-->
        <xsl:when test="*[@href][@role='next']">
          <xsl:apply-templates select="*[@href][@role='next'][1]" mode="breadcrumb"/>
        </xsl:when>
        <xsl:otherwise/>
      </xsl:choose>
      <!--if we have either next or previous, plus ancestors, separate the next/prev from the ancestors with a vertical bar-->
      <xsl:if test="(*[@href][@role='next'] or *[@href][@role='previous']) and *[@href][@role='ancestor']">
        <xsl:text> | </xsl:text>
      </xsl:if>
      <!--if ancestors exist, output them, and include a greater-than symbol after each one, including a trailing one-->
      <xsl:if test="*[@href][@role='ancestor']">
        <xsl:for-each select="*[@href][@role='ancestor']">
          <xsl:apply-templates select="."/> >
     </xsl:for-each>
      </xsl:if>
    </div>
    <xsl:value-of select="$newline"/>
  </xsl:for-each>
</xsl:template>
Template *[contains(@class,' topic/related-links ')]prereqs
Documentation

Description

create prerequisite links with all dups eliminated. 
Namespace No namespace
Match *[contains(@class,' topic/related-links ')]
Mode prereqs
References
Variable newline
Template getString
Key link
Import precedence 4
Source
<xsl:template match="*[contains(@class,' topic/related-links ')]" mode="prereqs">
  <!--if there are any prereqs create a list with dups-->
  <xsl:if test="descendant::*[contains(@class, ' topic/link ')][not(ancestor::*[contains(@class, ' topic/linklist ')])][@importance='required' and (not(@role) or @role='sibling' or @role='friend' or @role='previous' or @role='cousin')]">
    <xsl:value-of select="$newline"/>
    <dl class="prereqlinks">
      <xsl:value-of select="$newline"/>
      <dt class="prereq">
        <xsl:call-template name="getString">
          <xsl:with-param name="stringName" select="'Prerequisites'"/>
        </xsl:call-template>
      </dt>
      <xsl:value-of select="$newline"/>
      <!--only create link if there is an href, its importance is required, and the role is compatible (don't want a prereq showing up for a "next" or "parent" link, for example) - remove dups-->
      <xsl:apply-templates mode="prereqs" select="descendant::*[generate-id(.)=generate-id(key('link',concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href,@type,@role,@platform,@audience,@importance,@outputclass,@keyref,@scope,@format,@otherrole,@product,@otherprops,@rev,@class,child::*))[1])]      [@href]      [@importance='required' and (not(@role) or @role='sibling' or @role='friend' or @role='previous' or @role='cousin')]      [not(ancestor::*[contains(@class, ' topic/linklist ')])]"/>
    </dl>
    <xsl:value-of select="$newline"/>
  </xsl:if>
</xsl:template>
Template *[contains(@class,' topic/related-links ')]topic.related-links
Documentation

Description

main template for setting up all links after the body - applied to the related-links container
Namespace No namespace
Match *[contains(@class,' topic/related-links ')]
Mode #default
References
Import precedence 4
Source
<xsl:template match="*[contains(@class,' topic/related-links ')]" name="topic.related-links">
  <div>
    <xsl:call-template name="commonattributes"/>
    <xsl:call-template name="ul-child-links"/>
    <!--handle child/descendants outside of linklists in collection-type=unordered or choice-->
    <xsl:call-template name="ol-child-links"/>
    <!--handle child/descendants outside of linklists in collection-type=ordered/sequence-->
    <xsl:call-template name="next-prev-parent-links"/>
    <!--handle next and previous links-->
    <!-- Calls to typed links deprecated.  Grouping instead performed by related-links:group-unordered-links template. -->
    <!--<xsl:call-template name="concept-links"/>-->
    <!--sort remaining concept links by type-->
    <!--<xsl:call-template name="task-links"/>-->
    <!--sort remaining task links by type-->
    <!--<xsl:call-template name="reference-links"/>-->
    <!--sort remaining reference links by type-->
    <!--<xsl:call-template name="relinfo-links"/>-->
    <!--handle remaining untyped and unknown-type links-->
    <!-- Group all unordered links (which have not already been handled by prior sections). Skip duplicate links. -->
    <!-- NOTE: The actual grouping code for related-links:group-unordered-links is common between
             transform types, and is located in ../common/related-links.xsl. Actual code for
             creating group titles and formatting links is located in XSL files specific to each type. -->
    <xsl:apply-templates select="." mode="related-links:group-unordered-links">
      <xsl:with-param name="nodes" select="descendant::*[contains(@class, ' topic/link ')]        [count(. | key('omit-from-unordered-links', 1)) != count(key('omit-from-unordered-links', 1))]        [generate-id(.)=generate-id((key('hideduplicates', concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ',@href,@scope,@audience,@platform,@product,@otherprops,@rev,@type,normalize-space(child::*))))[1])]"/>
    </xsl:apply-templates>
    <!--linklists - last but not least, create all the linklists and their links, with no sorting or re-ordering-->
    <xsl:apply-templates select="*[contains(@class,' topic/linklist ')]"/>
  </div>
</xsl:template>
Template ul-child-links
Documentation

Description

children links - handle all child or descendant links except those in linklists or ordered collection-types.
Each child is indented, the linktext is bold, and the shortdesc appears in normal text directly below the link, to create a summary-like appearance.
Namespace No namespace
Used by
References
Variable newline
Key link
Import precedence 4
Source
<xsl:template name="ul-child-links">
  <xsl:if test="descendant::*[contains(@class, ' topic/link ')][@role='child' or @role='descendant'][not(parent::*/@collection-type='sequence')][not(ancestor::*[contains(@class, ' topic/linklist ')])]">
    <xsl:value-of select="$newline"/>
    <ul class="ullinks">
      <xsl:value-of select="$newline"/>
      <!--once you've tested that at least one child/descendant exists, apply templates to only the unique ones-->
      <xsl:apply-templates select="descendant::*           [generate-id(.)=generate-id(key('link',concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href,@type,@role,@platform,@audience,@importance,@outputclass,@keyref,@scope,@format,@otherrole,@product,@otherprops,@rev,@class,child::*))[1])]           [contains(@class, ' topic/link ')]           [@role='child' or @role='descendant']           [not(parent::*/@collection-type='sequence')]           [not(ancestor::*[contains(@class, ' topic/linklist ')])]"/>
    </ul>
    <xsl:value-of select="$newline"/>
  </xsl:if>
</xsl:template>
Template ol-child-links
Documentation

Description

children links - handle all child or descendant links in ordered collection-types.
Children are displayed in a numbered list, with the target title as the cmd and the shortdesc as info, like a task.
Namespace No namespace
Used by
References
Variable newline
Key link
Import precedence 4
Source
<xsl:template name="ol-child-links">
  <xsl:if test="descendant::*[contains(@class, ' topic/link ')][@role='child' or @role='descendant'][parent::*/@collection-type='sequence'][not(ancestor::*[contains(@class, ' topic/linklist ')])]">
    <xsl:value-of select="$newline"/>
    <ol>
      <xsl:value-of select="$newline"/>
      <!--once you've tested that at least one child/descendant exists, apply templates to only the unique ones-->
      <xsl:apply-templates select="descendant::*           [generate-id(.)=generate-id(key('link',concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href,@type,@role,@platform,@audience,@importance,@outputclass,@keyref,@scope,@format,@otherrole,@product,@otherprops,@rev,@class,child::*))[1])]           [contains(@class, ' topic/link ')]           [@role='child' or @role='descendant']           [parent::*/@collection-type='sequence']           [not(ancestor-or-self::*[contains(@class, ' topic/linklist ')])]"/>
    </ol>
    <xsl:value-of select="$newline"/>
  </xsl:if>
</xsl:template>
Template next-prev-parent-links
Documentation

Description

create the next and previous links, with accompanying parent link if any; create group for each unique parent, as well as for any next and previous links that aren't in the same group as a parent
Namespace No namespace
Used by
References
Key link
Variable newline
Parameter NOPARENTLINK
Template parentlink
Import precedence 4
Source
<xsl:template name="next-prev-parent-links">
  <xsl:for-each select="descendant::*      [contains(@class, ' topic/link ')]      [(@role='parent' and           generate-id(.)=generate-id(key('link',concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href,@type,@role,@platform,@audience,@importance,@outputclass,@keyref,@scope,@format,@otherrole,@product,@otherprops,@rev,@class,child::*))[1])      ) or (@role='next' and           generate-id(.)=generate-id(key('link',concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href,@type,@role,@platform,@audience,@importance,@outputclass,@keyref,@scope,@format,@otherrole,@product,@otherprops,@rev,@class,child::*))[1])      ) or (@role='previous' and           generate-id(.)=generate-id(key('link',concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href,@type,@role,@platform,@audience,@importance,@outputclass,@keyref,@scope,@format,@otherrole,@product,@otherprops,@rev,@class,child::*))[1])      )]/parent::*">
    <xsl:value-of select="$newline"/>
    <div class="familylinks">
      <xsl:value-of select="$newline"/>
      <xsl:if test="$NOPARENTLINK='no'">
        <xsl:choose>
          <xsl:when test="*[@href][@role='parent']">
            <xsl:for-each select="*[@href][@role='parent']">
              <div class="parentlink">
                <xsl:apply-templates select="."/>
              </div>
              <xsl:value-of select="$newline"/>
            </xsl:for-each>
          </xsl:when>
          <xsl:otherwise>
            <xsl:for-each select="*[@href][@role='ancestor'][last()]">
              <div class="parentlink">
                <xsl:call-template name="parentlink"/>
              </div>
              <xsl:value-of select="$newline"/>
            </xsl:for-each>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:if>
      <xsl:for-each select="*[@href][@role='previous']">
        <div class="previouslink">
          <xsl:apply-templates select="."/>
        </div>
        <xsl:value-of select="$newline"/>
      </xsl:for-each>
      <xsl:for-each select="*[@href][@role='next']">
        <div class="nextlink">
          <xsl:apply-templates select="."/>
        </div>
        <xsl:value-of select="$newline"/>
      </xsl:for-each>
    </div>
    <xsl:value-of select="$newline"/>
  </xsl:for-each>
</xsl:template>
Template concept-links
Documentation

Description

type templates: concept, task, reference, relinfo
 Deprecated! Use related-links:group-unordered-links template instead. 
Namespace No namespace
References
Templates getString; sort-links-by-role
Variable newline
Import precedence 4
Source
<xsl:template name="concept-links">
  <!-- Deprecated! Use related-links:group-unordered-links template instead. -->
  <!--related concepts - all the related concept links that haven't already been covered as a child/descendant/ancestor/next/previous/prerequisite, and aren't in a linklist-->
  <xsl:if test="descendant::*[contains(@class, ' topic/link ')]           [not(ancestor::*[contains(@class,' topic/linklist ')])]           [not(@role='child' or @role='descendant' or @role='ancestor' or @role='parent' or @role='next' or @role='previous')]           [not(@importance='required' and (not(@role) or @role='sibling' or @role='friend' or @role='cousin'))]           [@type='concept']">
    <div class="relconcepts">
      <strong>
        <xsl:call-template name="getString">
          <xsl:with-param name="stringName" select="'Related concepts'"/>
        </xsl:call-template>
      </strong>
      <br/>
      <xsl:value-of select="$newline"/>
      <!--once the related concepts section is set up, sort links by role within the section, using a shared sorting routine so that it's consistent across sections-->
      <xsl:call-template name="sort-links-by-role">
        <xsl:with-param name="type">concept</xsl:with-param></xsl:call-template>
    </div>
    <xsl:value-of select="$newline"/>
  </xsl:if>
</xsl:template>
Template task-links
Namespace No namespace
References
Templates getString; sort-links-by-role
Variable newline
Import precedence 4
Source
<xsl:template name="task-links">
  <!-- Deprecated! Use related-links:group-unordered-links template instead. -->
  <!--related tasks - all the related task links that haven't already been covered as a child/descendant/ancestor/next/previous/prerequisite, and aren't in a linklist-->
  <xsl:if test="descendant::*[contains(@class, ' topic/link ')]           [not(ancestor::*[contains(@class,' topic/linklist ')])]           [not(@role='child' or @role='descendant' or @role='ancestor' or @role='parent' or @role='next' or @role='previous')]           [not(@importance='required' and (not(@role) or @role='sibling' or @role='friend' or @role='cousin'))]           [@type='task']">
    <div class="reltasks">
      <strong>
        <xsl:call-template name="getString">
          <xsl:with-param name="stringName" select="'Related tasks'"/>
        </xsl:call-template>
      </strong>
      <br/>
      <xsl:value-of select="$newline"/>
      <!--once the related tasks section is set up, sort links by role within the section, using a shared sorting routine so that it's consistent across sections-->
      <xsl:call-template name="sort-links-by-role">
        <xsl:with-param name="type">task</xsl:with-param></xsl:call-template>
    </div>
    <xsl:value-of select="$newline"/>
  </xsl:if>
</xsl:template>
Template reference-links
Namespace No namespace
References
Templates getString; sort-links-by-role
Variable newline
Import precedence 4
Source
<xsl:template name="reference-links">
  <!-- Deprecated! Use related-links:group-unordered-links template instead. -->
  <!--related reference - all the related reference links that haven't already been covered as a child/descendant/ancestor/next/previous/prerequisite, and aren't in a linklist-->
  <xsl:if test="descendant::*           [contains(@class, ' topic/link ')]           [not(ancestor::*[contains(@class,' topic/linklist ')])]           [not(@role='child' or @role='descendant' or @role='ancestor' or @role='parent' or @role='next' or @role='previous')]           [not(@importance='required' and (not(@role) or @role='sibling' or @role='friend' or @role='cousin'))]           [@type='reference']">
    <div class="relref">
      <strong>
        <xsl:call-template name="getString">
          <xsl:with-param name="stringName" select="'Related reference'"/>
        </xsl:call-template>
      </strong>
      <br/>
      <xsl:value-of select="$newline"/>
      <!--once the related reference section is set up, sort links by role within the section, using a shared sorting routine so that it's consistent across sections-->
      <xsl:call-template name="sort-links-by-role">
        <xsl:with-param name="type">reference</xsl:with-param></xsl:call-template>
    </div>
    <xsl:value-of select="$newline"/>
  </xsl:if>
</xsl:template>
Template relinfo-links
Namespace No namespace
References
Template getString
Variable newline
Key link
Import precedence 4
Source
<xsl:template name="relinfo-links">
  <!-- Deprecated! Use related-links:group-unordered-links template instead. -->
  <!--other info- - not currently sorting by role, since already mixing any number of types in here-->
  <!--if there are links not covered by any of the other routines - ie, not in a linklist, not a child or descendant, not a concept/task/reference, not ancestor/next/previous, not prerequisite - create a section for them and create the links-->
  <xsl:if test="descendant::* [contains(@class, ' topic/link ')] [not(ancestor::*[contains(@class,' topic/linklist ')])]           [not(@role='child' or @role='descendant' or @role='ancestor' or @role='parent' or @role='next' or @role='previous' or @type='concept' or @type='task' or @type='reference')]           [not(@importance='required' and (not(@role) or @role='sibling' or @role='friend' or @role='cousin'))]">
    <div class="relinfo">
      <strong>
        <xsl:call-template name="getString">
          <xsl:with-param name="stringName" select="'Related information'"/>
        </xsl:call-template>
      </strong>
      <br/>
      <xsl:value-of select="$newline"/>
      <!--once section is created, create the links, using the same rules as bove plus a uniqueness check-->
      <xsl:for-each select="descendant::*           [not(ancestor::*[contains(@class,' topic/linklist ')])]           [generate-id(.)=generate-id(key('link',concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href,@type,@role,@platform,@audience,@importance,@outputclass,@keyref,@scope,@format,@otherrole,@product,@otherprops,@rev,@class,child::*))[1])] [contains(@class, ' topic/link ')]           [not(@role='child' or @role='descendant' or @role='ancestor' or @role='parent' or @role='next' or @role='previous' or @type='concept' or @type='task' or @type='reference')]           [not(@importance='required' and (not(@role) or @role='sibling' or @role='friend' or @role='cousin'))]">
        <xsl:apply-templates select="."/>
      </xsl:for-each>
    </div>
    <xsl:value-of select="$newline"/>
  </xsl:if>
</xsl:template>
Template sort-links-by-role
Documentation
Namespace No namespace
Used by
References
Parameters
Import precedence 4
Source
Template create-links
Namespace No namespace
Used by
References
Key link
Parameters
QName Namespace
role No namespace
type No namespace
Import precedence 4
Source
<xsl:template name="create-links">
  <!-- Deprecated! Use related-links:group-unordered-links template instead. -->
  <!--create links of the specified type and role-->
  <xsl:param name="type">topic</xsl:param>
  <xsl:param name="role">friend</xsl:param>
  <xsl:choose>
    <!--when processing links with no role, apply templates to links that are unique, not in a linklist, don't have a role attribute, match the specified type, and aren't prerequisites-->
    <xsl:when test="$role='#none#'">
      <xsl:for-each select="descendant::*                [generate-id(.)=generate-id(key('link',concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href,@type,@role,@platform,@audience,@importance,@outputclass,@keyref,@scope,@format,@otherrole,@product,@otherprops,@rev,@class,child::*))[1])]                [contains(@class, ' topic/link ')]                [not(ancestor::*[contains(@class,' topic/linklist ')])]                [not(@role)]                [@type=$type]                [not(@importance='required')]">
        <xsl:apply-templates select="."/>
      </xsl:for-each>
    </xsl:when>
    <!--when processing links with a specified role, apply templates to links that are unique, not in a linklist, match the specified role and type, and aren't prerequisites-->
    <xsl:otherwise>
      <xsl:for-each select="descendant::*                [generate-id(.)=generate-id(key('link',concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href,@type,@role,@platform,@audience,@importance,@outputclass,@keyref,@scope,@format,@otherrole,@product,@otherprops,@rev,@class,child::*))[1])]                [not(ancestor::*[contains(@class,' topic/linklist ')])]                [contains(@class, ' topic/link ')]                [@role=$role]                [@type=$type]                [not(@importance='required' and (@role='sibling' or @role='friend' or @role='previous' or @role='cousin'))]">
        <xsl:apply-templates select="."/>
      </xsl:for-each>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Template *[contains(@class, ' topic/link ')]related-links:group-result.{http://dita-ot.sourceforge.net/ns/200709/related-links}result-group
Documentation

Description

 Override no-name group wrapper template for HTML: output "Related Information" in a <div>. 
Namespace http://dita-ot.sourceforge.net/ns/200709/related-links
Match *[contains(@class, ' topic/link ')]
Mode {http://dita-ot.sourceforge.net/ns/200709/related-links}result-group
Used by
References
Template getString
Variable newline
Supersedes
Parameters
QName Namespace
links No namespace
Import precedence 4
Source
<xsl:template match="*[contains(@class, ' topic/link ')]" mode="related-links:result-group" name="related-links:group-result.">
  <xsl:param name="links"/>
  <div class="relinfo">
    <strong>
      <xsl:call-template name="getString">
        <xsl:with-param name="stringName" select="'Related information'"/>
      </xsl:call-template>
    </strong>
    <br/>
    <xsl:value-of select="$newline"/>
    <xsl:copy-of select="$links"/>
  </div>
  <xsl:value-of select="$newline"/>
</xsl:template>
Template *[contains(@class, ' topic/link ')][@type='topic']related-links:group-priority.topic{http://dita-ot.sourceforge.net/ns/200709/related-links}get-group-priority
Documentation

Description

 Links with @type="topic" belong in no-name group. 
Namespace http://dita-ot.sourceforge.net/ns/200709/related-links
Match *[contains(@class, ' topic/link ')][@type='topic']
Mode {http://dita-ot.sourceforge.net/ns/200709/related-links}get-group-priority
References
Import precedence 4
Priority 2
Source
<xsl:template match="*[contains(@class, ' topic/link ')][@type='topic']" mode="related-links:get-group-priority" name="related-links:group-priority.topic" priority="2">
  <xsl:call-template name="related-links:group-priority."/>
</xsl:template>
Template *[contains(@class, ' topic/link ')][@type='topic']related-links:group.topic{http://dita-ot.sourceforge.net/ns/200709/related-links}get-group
Namespace http://dita-ot.sourceforge.net/ns/200709/related-links
Match *[contains(@class, ' topic/link ')][@type='topic']
Mode {http://dita-ot.sourceforge.net/ns/200709/related-links}get-group
References
Import precedence 4
Priority 2
Source
<xsl:template match="*[contains(@class, ' topic/link ')][@type='topic']" mode="related-links:get-group" name="related-links:group.topic" priority="2">
  <xsl:call-template name="related-links:group."/>
</xsl:template>
Template *[contains(@class, ' topic/link ')][@type='topic']related-links:group-result.topic{http://dita-ot.sourceforge.net/ns/200709/related-links}result-group
Namespace http://dita-ot.sourceforge.net/ns/200709/related-links
Match *[contains(@class, ' topic/link ')][@type='topic']
Mode {http://dita-ot.sourceforge.net/ns/200709/related-links}result-group
References
Parameters
QName Namespace
links No namespace
Import precedence 4
Priority 2
Source
<xsl:template match="*[contains(@class, ' topic/link ')][@type='topic']" mode="related-links:result-group" name="related-links:group-result.topic" priority="2">
  <xsl:param name="links"/>
  <xsl:call-template name="related-links:group-result.">
    <xsl:with-param name="links" select="$links"/>
  </xsl:call-template>
</xsl:template>
Template href
Documentation

Description

calculate href
Namespace No namespace
Used by
Import precedence 4
Source
<xsl:template name="href">
  <xsl:apply-templates select="." mode="determine-final-href"/>
</xsl:template>
Template *determine-final-href
Namespace No namespace
Match *
Mode determine-final-href
References
Template parsehref
Parameters DITAEXT; OUTEXT
Import precedence 4
Source
<xsl:template match="*" mode="determine-final-href">
  <xsl:choose>
    <xsl:when test="normalize-space(@href)='' or not(@href)"/>
    <!-- For non-DITA formats - use the href as is -->
    <xsl:when test="(not(@format) and (@type='external' or @scope='external' or @scope='peer')) or (@format and not(@format='dita' or @format='DITA'))">
      <xsl:value-of select="@href"/>
    </xsl:when>
    <!-- For DITA - process the internal href -->
    <xsl:when test="starts-with(@href,'#')">
      <xsl:call-template name="parsehref">
        <xsl:with-param name="href" select="@href"/>
      </xsl:call-template>
    </xsl:when>
    <!-- It's to a DITA file - process the file name (adding the html extension)
         and process the rest of the href -->
    <xsl:when test="contains(@href,$DITAEXT)">
      <!-- Added this variable to support href values such as "com.example.dita.stuff/topic.dita". These
           previously generated the output extension after the first .dita -->
      <xsl:variable name="hrefBeforeExtension">
        <xsl:choose>
          <xsl:when test="contains(@href,concat($DITAEXT,'#'))">
            <xsl:value-of select="substring-before(@href,concat($DITAEXT,'#'))"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="." mode="parseHrefUptoExtension"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <xsl:value-of select="$hrefBeforeExtension"/>
      <xsl:value-of select="$OUTEXT"/>
      <xsl:call-template name="parsehref">
        <xsl:with-param name="href" select="substring-after(@href,concat($hrefBeforeExtension,$DITAEXT))"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:apply-templates select="." mode="ditamsg:unknown-extension"/>
      <xsl:value-of select="@href"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Template parsehref
Documentation

Description

 "/" is not legal in IDs - need to swap it with two underscores 
Namespace No namespace
Used by
Parameters
QName Namespace
href No namespace
Import precedence 4
Source
<xsl:template name="parsehref">
  <xsl:param name="href"/>
  <xsl:choose>
    <xsl:when test="contains($href,'/')">
      <xsl:value-of select="substring-before($href,'/')"/>__
      <xsl:value-of select="substring-after($href,'/')"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$href"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Template *[contains(@class, ' topic/link ')][@role='next' or @role='previous']breadcrumb
Documentation

Description

breadcrumb template: next, prev
Namespace No namespace
Match *[contains(@class, ' topic/link ')][@role='next' or @role='previous']
Mode breadcrumb
References
Import precedence 4
Source
<xsl:template match="*[contains(@class, ' topic/link ')][@role='next' or @role='previous']" mode="breadcrumb">
  <xsl:variable name="flagrules">
    <xsl:call-template name="getrules"/>
  </xsl:variable>
  <xsl:call-template name="start-flags-and-rev">
    <xsl:with-param name="flagrules" select="$flagrules"/>
  </xsl:call-template>
  <a>
    <xsl:call-template name="commonattributes"/>
    <xsl:apply-templates select="." mode="add-linking-attributes"/>
    <xsl:apply-templates select="." mode="add-title-as-hoverhelp"/>
    <!-- Allow for unknown metadata (future-proofing) -->
    <xsl:apply-templates select="*[contains(@class,' topic/data ') or contains(@class,' topic/foreign ')]"/>
    <!--use string as output link text for now, use image eventually-->
    <xsl:choose>
      <xsl:when test="@role='next'">
        <xsl:call-template name="getString">
          <xsl:with-param name="stringName" select="'Next topic'"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:when test="@role='previous'">
        <xsl:call-template name="getString">
          <xsl:with-param name="stringName" select="'Previous topic'"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <!--both role values tested - no otherwise-->
      </xsl:otherwise>
    </xsl:choose>
  </a>
  <xsl:call-template name="end-flags-and-rev">
    <xsl:with-param name="flagrules" select="$flagrules"/>
  </xsl:call-template>
</xsl:template>
Template *[contains(@class, ' topic/link ')]prereqs
Documentation

Description

prereq template
Namespace No namespace
Match *[contains(@class, ' topic/link ')]
Mode prereqs
References
Template makelink
Variable newline
Import precedence 4
Priority 2
Source
<xsl:template mode="prereqs" match="*[contains(@class, ' topic/link ')]" priority="2">
  <dd>
    <!-- Allow for unknown metadata (future-proofing) -->
    <xsl:apply-templates select="*[contains(@class,' topic/data ') or contains(@class,' topic/foreign ')]"/>
    <xsl:call-template name="makelink"/>
  </dd>
  <xsl:value-of select="$newline"/>
</xsl:template>
Template *[contains(@class, ' topic/link ')][@role='next']nextlink
Documentation
Namespace No namespace
Match *[contains(@class, ' topic/link ')][@role='next']
Mode #default
References
Import precedence 4
Priority 2
Source
Template *[contains(@class, ' topic/link ')][@role='previous']prevlink
Namespace No namespace
Match *[contains(@class, ' topic/link ')][@role='previous']
Mode #default
References
Import precedence 4
Priority 2
Source
Template *[contains(@class, ' topic/link ')][@role='parent']parentlink
Namespace No namespace
Match *[contains(@class, ' topic/link ')][@role='parent']
Mode #default
Used by
References
Import precedence 4
Priority 2
Source
Template *[contains(@class, ' topic/link ')][@role='child' or @role='descendant']topic.link_child
Documentation
Namespace No namespace
Match *[contains(@class, ' topic/link ')][@role='child' or @role='descendant']
Mode #default
References
Import precedence 4
Priority 2
Source
Template *[@collection-type='sequence']/*[contains(@class, ' topic/link ')][@role='child' or @role='descendant']topic.link_orderedchild
Documentation
Namespace No namespace
Match *[@collection-type='sequence']/*[contains(@class, ' topic/link ')][@role='child' or @role='descendant']
Mode #default
References
Import precedence 4
Priority 3
Source
Template *[contains(@class, ' topic/link ')]topic.link
Namespace No namespace
Match *[contains(@class, ' topic/link ')]
Mode #default
References
Import precedence 4
Source
Template makelink
Documentation
Namespace No namespace
Used by
References
Import precedence 4
Source
Template *[contains(@class, ' topic/linktext ')]topic.linktext
Documentation

Description

process linktext elements by explicitly ignoring them and applying templates to their content; otherwise flagged as unprocessed content by the dit2htm transform
Namespace No namespace
Match *[contains(@class, ' topic/linktext ')]
Mode #default
Import precedence 4
Source
<xsl:template match="*[contains(@class, ' topic/linktext ')]" name="topic.linktext">
  <xsl:apply-templates select="*|text()"/>
</xsl:template>
Template *[contains(@class, ' topic/link ')]/*[contains(@class, ' topic/desc ')]topic.link_desc
Documentation
Namespace No namespace
Match *[contains(@class, ' topic/link ')]/*[contains(@class, ' topic/desc ')]
Mode #default
Import precedence 4
Source
Template *[contains(@class,' topic/linklist ')]topic.linklist
Documentation

Description

linklists
Namespace No namespace
Match *[contains(@class,' topic/linklist ')]
Mode #default
References
Variable newline
Import precedence 4
Source
<xsl:template match="*[contains(@class,' topic/linklist ')]" name="topic.linklist">
  <xsl:value-of select="$newline"/>
  <xsl:choose>
    <!--if this is a first-level linklist with no child links in it, put it in a div (flush left)-->
    <xsl:when test="parent::*[contains(@class,' topic/related-links ')] and not(child::*[contains(@class,' topic/link ')][@role='child' or @role='descendant'])">
      <div class="linklist">
        <xsl:apply-templates select="." mode="processlinklist"/>
      </div>
    </xsl:when>
    <!-- When it contains children, indent with child class -->
    <xsl:when test="child::*[contains(@class,' topic/link ')][@role='child' or @role='descendant']">
      <div class="linklistwithchild">
        <xsl:apply-templates select="." mode="processlinklist">
          <xsl:with-param name="default-list-type" select="'linklistwithchild'"/>
        </xsl:apply-templates>
      </div>
    </xsl:when>
    <!-- It is a nested linklist, indent with other class -->
    <xsl:otherwise>
      <div class="sublinklist">
        <xsl:apply-templates select="." mode="processlinklist">
          <xsl:with-param name="default-list-type" select="'sublinklist'"/>
        </xsl:apply-templates>
      </div>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:value-of select="$newline"/>
</xsl:template>
Template processlinklist
Namespace No namespace
Import precedence 4
Source
<xsl:template name="processlinklist">
  <xsl:apply-templates select="." mode="processlinklist"/>
</xsl:template>
Template *processlinklist
Namespace No namespace
Match *
Mode processlinklist
References
Template commonattributes
Variable newline
Parameters
QName Namespace Select
default-list-type No namespace 'linklist'
Import precedence 4
Source
<xsl:template match="*" mode="processlinklist">
  <xsl:param name="default-list-type" select="'linklist'"/>
  <xsl:call-template name="commonattributes">
    <xsl:with-param name="default-output-class" select="$default-list-type"/>
  </xsl:call-template>
  <xsl:apply-templates select="*[contains(@class, ' topic/title ')]"/>
  <xsl:apply-templates select="*[contains(@class,' topic/desc ')]"/>
  <xsl:for-each select="*[contains(@class,' topic/linklist ')]|*[contains(@class,' topic/link ')]">
    <xsl:choose>
      <!-- for children, div wrapper is created in main template -->
      <xsl:when test="contains(@class,' topic/link ') and (@role='child' or @role='descendant')">
        <xsl:value-of select="$newline"/>
        <xsl:apply-templates select="."/>
      </xsl:when>
      <xsl:when test="contains(@class,' topic/link ')">
        <xsl:value-of select="$newline"/>
        <div>
          <xsl:apply-templates select="."/>
        </div>
      </xsl:when>
      <xsl:otherwise>
        <!-- nested linklist -->
        <xsl:apply-templates select="."/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:for-each>
  <xsl:apply-templates select="*[contains(@class,' topic/linkinfo ')]"/>
</xsl:template>
Template *[contains(@class,' topic/linkinfo ')]topic.linkinfo
Namespace No namespace
Match *[contains(@class,' topic/linkinfo ')]
Mode #default
References
Variable newline
Import precedence 4
Source
<xsl:template match="*[contains(@class,' topic/linkinfo ')]" name="topic.linkinfo">
  <xsl:apply-templates/>
  <br/>
  <xsl:value-of select="$newline"/>
</xsl:template>
Template *[contains(@class, ' topic/linklist ')]/*[contains(@class, ' topic/title ')]topic.linklist_title
Namespace No namespace
Match *[contains(@class, ' topic/linklist ')]/*[contains(@class, ' topic/title ')]
Mode #default
References
Import precedence 4
Source
Template *[contains(@class, ' topic/linklist ')]/*[contains(@class, ' topic/desc ')]topic.linklist_desc
Namespace No namespace
Match *[contains(@class, ' topic/linklist ')]/*[contains(@class, ' topic/desc ')]
Mode #default
References
Import precedence 4
Source
Template linkdupinfo
Namespace No namespace
Used by
Templates makelink; topic.link
References
Keys link; linkdup
Import precedence 4
Source
<xsl:template name="linkdupinfo">
  <xsl:if test="(key('linkdup', concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href)))[2]">
    <xsl:if test="generate-id(.)=generate-id((key('linkdup', concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href)))[1])">
      <!-- If the link is exactly the same, do not output message.  The duplicate will automatically be removed. -->
      <xsl:if test="not(key('link', concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href,@type,@role,@platform,@audience,@importance,@outputclass,@keyref,@scope,@format,@otherrole,@product,@otherprops,@rev,@class,child::*))[2])">
        <xsl:apply-templates select="." mode="ditamsg:link-may-be-duplicate"/>
      </xsl:if>
    </xsl:if>
  </xsl:if>
</xsl:template>
Template *add-desc-as-hoverhelp
Documentation

Description

 Match an xref or link and add hover help.
     Normal treatment: if desc is present and not empty, create hovertext.
     Using title (for next/previous links, etc): always create, use title or target. 
Namespace No namespace
Match *
Mode add-desc-as-hoverhelp
Import precedence 4
Source
<xsl:template match="*" mode="add-desc-as-hoverhelp">
  <xsl:if test="*[contains(@class,' topic/desc ')]">
    <xsl:variable name="hovertext">
      <xsl:apply-templates select="*[contains(@class,' topic/desc ')][1]" mode="text-only"/>
    </xsl:variable>
    <xsl:if test="normalize-space($hovertext)!=''">
      <xsl:attribute name="title">
        <xsl:value-of select="normalize-space($hovertext)"/>
      </xsl:attribute>
    </xsl:if>
  </xsl:if>
</xsl:template>
Template *add-title-as-hoverhelp
Namespace No namespace
Match *
Mode add-title-as-hoverhelp
References
Template href
Import precedence 4
Source
<xsl:template match="*" mode="add-title-as-hoverhelp">
  <!--use link element's linktext as hoverhelp-->
  <xsl:attribute name="title">
    <xsl:choose>
      <xsl:when test="*[contains(@class, ' topic/linktext ')]">
        <xsl:value-of select="normalize-space(*[contains(@class, ' topic/linktext ')])"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="href"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:attribute>
</xsl:template>
Template *add-hoverhelp-to-child-links
Namespace No namespace
Match *
Mode add-hoverhelp-to-child-links
Import precedence 4
Source
<xsl:template match="*" mode="add-hoverhelp-to-child-links">
  <!-- By default, desc comes out inline, so no hover help is added.
       Can override this template to add hover help to child links. -->
</xsl:template>
Template add-linking-attributes
Documentation

Description

 DEPRECATED: use mode template instead 
Namespace No namespace
References
Import precedence 4
Source
<xsl:template name="add-linking-attributes">
  <xsl:if test="@href and normalize-space(@href)!=''">
    <xsl:attribute name="href">
      <xsl:call-template name="href"/>
    </xsl:attribute>
  </xsl:if>
  <xsl:call-template name="commonattributes"/>
  <xsl:call-template name="add-link-target-attribute"/>
  <xsl:call-template name="add-user-link-attributes"/>
</xsl:template>
Template *add-linking-attributes
Documentation

Description

 When converting to mode template, move commonattributes out;
     this template is dedicated to linking based attributes, and
     allows the common linking set to be used when commonattributes
     already exists for an ancestor. 
Namespace No namespace
Match *
Mode add-linking-attributes
Import precedence 4
Source
<xsl:template match="*" mode="add-linking-attributes">
  <xsl:apply-templates select="." mode="add-href-attribute"/>
  <xsl:apply-templates select="." mode="add-link-target-attribute"/>
  <xsl:apply-templates select="." mode="add-custom-link-attributes"/>
</xsl:template>
Template *add-href-attribute
Namespace No namespace
Match *
Mode add-href-attribute
Import precedence 4
Source
<xsl:template match="*" mode="add-href-attribute">
  <xsl:if test="@href and normalize-space(@href)!=''">
    <xsl:attribute name="href">
      <xsl:apply-templates select="." mode="determine-final-href"/>
    </xsl:attribute>
  </xsl:if>
</xsl:template>
Template add-link-target-attribute
Namespace No namespace
Used by
Import precedence 4
Source
Template *add-link-target-attribute
Namespace No namespace
Match *
Mode add-link-target-attribute
Import precedence 4
Source
Template add-user-link-attributes
Namespace No namespace
Used by
Import precedence 4
Source
Template *{http://dita-ot.sourceforge.net/ns/200704/ditamsg}unknown-extension
Namespace No namespace
Match *
Mode {http://dita-ot.sourceforge.net/ns/200704/ditamsg}unknown-extension
References
Template output-message
Parameters
QName Namespace Select
href No namespace @href
Import precedence 4
Source
<xsl:template match="*" mode="ditamsg:unknown-extension">
  <xsl:param name="href" select="@href"/>
  <xsl:call-template name="output-message">
    <xsl:with-param name="msgnum">006</xsl:with-param>
    <xsl:with-param name="msgsev">E</xsl:with-param>
    <xsl:with-param name="msgparams">%1=
      <xsl:value-of select="$href"/>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Template *{http://dita-ot.sourceforge.net/ns/200704/ditamsg}link-may-be-duplicate
Namespace No namespace
Match *
Mode {http://dita-ot.sourceforge.net/ns/200704/ditamsg}link-may-be-duplicate
References
Parameters
Import precedence 4
Source
Parameter NOPARENTLINK
Namespace No namespace
Select 'no'
Used by
Source
Output (default)
Namespace No namespace
Output properties
method encoding indent
utf-8 yes
Source
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
Key link
Namespace No namespace
Match *[contains(@class, ' topic/link ')][not(ancestor::*[contains(@class, ' topic/linklist ')])]
Use concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href,@type,@role,@platform,@audience,@importance,@outputclass,@keyref,@scope,@format,@otherrole,@product,@otherprops,@rev,@class,child::*)
Used by
Source
Key linkdup
Namespace No namespace
Match *[contains(@class, ' topic/link ')][not(ancestor::*[contains(@class, ' topic/linklist ')])][not(@role='child' or @role='parent' or @role='previous' or @role='next' or @role='ancestor' or @role='descendant')]
Use concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href)
Used by
Template linkdupinfo
Source
<xsl:key name="linkdup" match="*[contains(@class, ' topic/link ')][not(ancestor::*[contains(@class, ' topic/linklist ')])][not(@role='child' or @role='parent' or @role='previous' or @role='next' or @role='ancestor' or @role='descendant')]" use="concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ', @href)"/>
Key hideduplicates
Namespace No namespace
Match *[contains(@class, ' topic/link ')][not(ancestor::*[contains(@class, ' topic/linklist ')])][not(@role) or @role='cousin' or @role='external' or @role='friend' or @role='other' or @role='sample' or @role='sibling']
Use concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ',@href,@scope,@audience,@platform,@product,@otherprops,@rev,@type,normalize-space(child::*))
Used by
Source
<xsl:key name="hideduplicates" match="*[contains(@class, ' topic/link ')][not(ancestor::*[contains(@class, ' topic/linklist ')])][not(@role) or @role='cousin' or @role='external' or @role='friend' or @role='other' or @role='sample' or @role='sibling']" use="concat(ancestor::*[contains(@class, ' topic/related-links ')]/parent::*[contains(@class, ' topic/topic ')]/@id, ' ',@href,@scope,@audience,@platform,@product,@otherprops,@rev,@type,normalize-space(child::*))"/>
Key omit-from-unordered-links
Namespace No namespace
Match *[ancestor::*[contains(@class,' topic/linklist ')]]
Use 1
Used by
Source
<xsl:key name="omit-from-unordered-links" match="*[ancestor::*[contains(@class,' topic/linklist ')]]" use="1"/>