conceptdisplay.xsl 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. This file is part of the DITA Open Toolkit project.
  4. Copyright 2010 IBM Corporation
  5. See the accompanying LICENSE file for applicable license.
  6. -->
  7. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
  8. xmlns:related-links="http://dita-ot.sourceforge.net/ns/200709/related-links"
  9. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  10. exclude-result-prefixes="related-links xs">
  11. <!-- Concepts have their own group. -->
  12. <xsl:template match="*[contains(@class, ' topic/link ')][@type='concept']" mode="related-links:get-group"
  13. name="related-links:group.concept"
  14. as="xs:string">
  15. <xsl:text>concept</xsl:text>
  16. </xsl:template>
  17. <!-- Priority of concept group. -->
  18. <xsl:template match="*[contains(@class, ' topic/link ')][@type='concept']" mode="related-links:get-group-priority"
  19. name="related-links:group-priority.concept"
  20. as="xs:integer">
  21. <xsl:sequence select="3"/>
  22. </xsl:template>
  23. <!-- Wrapper for concept group: "Related concepts" in a <div>. -->
  24. <xsl:template match="*[contains(@class, ' topic/link ')][@type='concept']" mode="related-links:result-group"
  25. name="related-links:result.concept" as="element()?">
  26. <xsl:param name="links" as="node()*"/>
  27. <xsl:if test="normalize-space(string-join($links, ''))">
  28. <linklist class="- topic/linklist " outputclass="relinfo relconcepts">
  29. <xsl:copy-of select="ancestor-or-self::*[@xml:lang][1]/@xml:lang"/>
  30. <title class="- topic/title ">
  31. <xsl:call-template name="getVariable">
  32. <xsl:with-param name="id" select="'Related concepts'"/>
  33. </xsl:call-template>
  34. </title>
  35. <xsl:copy-of select="$links"/>
  36. </linklist>
  37. </xsl:if>
  38. </xsl:template>
  39. </xsl:stylesheet>