abbrev-d.xsl 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <xsl:stylesheet version="2.0"
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. xmlns:ditamsg="http://dita-ot.sourceforge.net/ns/200704/ditamsg"
  5. exclude-result-prefixes="ditamsg">
  6. <xsl:template match="*[contains(@class,' abbrev-d/abbreviated-form ')]" name="topic.abbreviated-form">
  7. <xsl:if test="@keyref and @href">
  8. <xsl:variable name="entry-file" select="concat($WORKDIR, $PATH2PROJ, @href)"/>
  9. <xsl:variable name="entry-file-contents" select="document($entry-file, /)"/>
  10. <xsl:choose>
  11. <xsl:when test="$entry-file-contents//*[contains(@class,' glossentry/glossentry ')]">
  12. <!-- Fall back to process with normal term rules -->
  13. <xsl:call-template name="topic.term"/>
  14. </xsl:when>
  15. <xsl:otherwise>
  16. <!-- TODO: Throw a warning for incorrect usage of <abbreviated-form> -->
  17. <xsl:apply-templates select="." mode="ditamsg:no-glossentry-for-abbreviated-form">
  18. <xsl:with-param name="keys" select="@keyref"/>
  19. </xsl:apply-templates>
  20. </xsl:otherwise>
  21. </xsl:choose>
  22. </xsl:if>
  23. </xsl:template>
  24. <xsl:template match="*" mode="ditamsg:no-glossentry-for-abbreviated-form">
  25. <xsl:param name="keys"/>
  26. <xsl:call-template name="output-message">
  27. <xsl:with-param name="id">DOTX060W</xsl:with-param>
  28. <xsl:with-param name="msgparams">%1=<xsl:value-of select="$keys"/></xsl:with-param>
  29. </xsl:call-template>
  30. </xsl:template>
  31. </xsl:stylesheet>