abbrev-d.xsl 1.8 KB

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