conceptdisplay.xsl 1.7 KB

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