abbrev-d.xsl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. <xsl:template match="*[contains(@class,' abbrev-d/abbreviated-form ')]" name="topic.abbreviated-form">
  13. <xsl:if test="@keyref and @href">
  14. <xsl:variable name="entry-file-contents" as="node()*"
  15. select="dita-ot:retrieve-href-target(@href)"/>
  16. <xsl:choose>
  17. <xsl:when test="$entry-file-contents/descendant-or-self::*[contains(@class,' glossentry/glossentry ')]">
  18. <!-- Fall back to process with normal term rules -->
  19. <xsl:call-template name="topic.term"/>
  20. </xsl:when>
  21. <xsl:otherwise>
  22. <!-- TODO: Throw a warning for incorrect usage of <abbreviated-form> -->
  23. <xsl:apply-templates select="." mode="ditamsg:no-glossentry-for-abbreviated-form">
  24. <xsl:with-param name="keys" select="@keyref"/>
  25. </xsl:apply-templates>
  26. </xsl:otherwise>
  27. </xsl:choose>
  28. </xsl:if>
  29. </xsl:template>
  30. <xsl:template match="*" mode="ditamsg:no-glossentry-for-abbreviated-form">
  31. <xsl:param name="keys"/>
  32. <xsl:call-template name="output-message">
  33. <xsl:with-param name="id" select="'DOTX060W'"/>
  34. <xsl:with-param name="msgparams">%1=<xsl:value-of select="$keys"/></xsl:with-param>
  35. </xsl:call-template>
  36. </xsl:template>
  37. </xsl:stylesheet>