abbrev-d.xsl 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!-- This file is part of the DITA Open Toolkit project hosted on
  3. Sourceforge.net. See the accompanying license.txt file for
  4. applicable licenses.-->
  5. <!-- (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved. -->
  6. <xsl:stylesheet version="2.0"
  7. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  8. xmlns:ditamsg="http://dita-ot.sourceforge.net/ns/200704/ditamsg"
  9. xmlns:dita-ot="http://dita-ot.sourceforge.net/ns/201007/dita-ot"
  10. exclude-result-prefixes="ditamsg dita-ot">
  11. <!-- KEYREF-FILE is defined in dita2htmlImpl.xsl: -->
  12. <!--<xsl:param name="KEYREF-FILE" select="concat($WORKDIR,$PATH2PROJ,'keydef.xml')"/>-->
  13. <xsl:template match="*[contains(@class,' abbrev-d/abbreviated-form ')]" name="topic.abbreviated-form">
  14. <xsl:if test="@keyref and @href">
  15. <xsl:variable name="entry-file-contents" as="node()*"
  16. select="dita-ot:retrieve-href-target(@href)"/>
  17. <xsl:choose>
  18. <xsl:when test="$entry-file-contents/descendant-or-self::*[contains(@class,' glossentry/glossentry ')]">
  19. <!-- Fall back to process with normal term rules -->
  20. <xsl:call-template name="topic.term"/>
  21. </xsl:when>
  22. <xsl:otherwise>
  23. <!-- TODO: Throw a warning for incorrect usage of <abbreviated-form> -->
  24. <xsl:apply-templates select="." mode="ditamsg:no-glossentry-for-abbreviated-form">
  25. <xsl:with-param name="keys" select="@keyref"/>
  26. </xsl:apply-templates>
  27. </xsl:otherwise>
  28. </xsl:choose>
  29. </xsl:if>
  30. </xsl:template>
  31. <xsl:template match="*" mode="ditamsg:no-glossentry-for-abbreviated-form">
  32. <xsl:param name="keys"/>
  33. <xsl:call-template name="output-message">
  34. <xsl:with-param name="id" select="'DOTX060W'"/>
  35. <xsl:with-param name="msgparams">%1=<xsl:value-of select="$keys"/></xsl:with-param>
  36. </xsl:call-template>
  37. </xsl:template>
  38. </xsl:stylesheet>