map2javahelpmap.xsl 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. <!-- stylesheet imports -->
  9. <xsl:import href="plugin:org.dita.xhtml:xsl/xslhtml/map2TOC.xsl"/>
  10. <xsl:import href="plugin:org.dita.base:xsl/common/output-message.xsl"/>
  11. <xsl:import href="plugin:org.dita.base:xsl/common/dita-utilities.xsl"/>
  12. <!-- default "output extension" processing parameter ('.html')-->
  13. <xsl:param name="OUTEXT" select="'.html'"/><!-- "htm" and "html" are valid values -->
  14. <!-- Deprecated since 2.3 -->
  15. <xsl:variable name="msgprefix">DOTX</xsl:variable>
  16. <xsl:output
  17. method="xml"
  18. omit-xml-declaration="no"
  19. encoding="UTF-8"
  20. indent="yes"
  21. />
  22. <xsl:template match="*[contains(@class,' map/map ')]" mode="toctop">
  23. <map version="2.0">
  24. <xsl:apply-templates select="*[contains(@class,' map/topicref ')]"/>
  25. </map>
  26. </xsl:template>
  27. <xsl:template match="*[contains(@class,' map/topicref ')]" mode="tocentry">
  28. <xsl:param name="infile"/>
  29. <xsl:param name="outroot"/>
  30. <xsl:param name="outfile"/>
  31. <xsl:param name="nodeID"/>
  32. <xsl:param name="isFirst"/>
  33. <xsl:param name="subtopicNodes"/>
  34. <xsl:param name="title"/>
  35. <xsl:if test="$isFirst">
  36. <xsl:if test="$outfile and $outfile!=''">
  37. <xsl:variable name="targetID" select="translate($outroot, '\/.', '___')"/>
  38. <mapID target="{$targetID}" url="{$outfile}"/>
  39. </xsl:if>
  40. <xsl:apply-templates select="$subtopicNodes"/>
  41. </xsl:if>
  42. <xsl:if test="$title">
  43. <xsl:if test="@copy-to">
  44. <xsl:variable name="copyToWithoutExtension">
  45. <xsl:call-template name="replace-extension">
  46. <xsl:with-param name="filename" select="@copy-to"/>
  47. <xsl:with-param name="extension" select="''"/>
  48. </xsl:call-template>
  49. </xsl:variable>
  50. <xsl:variable name="targetID" select="translate($copyToWithoutExtension, '\/.', '___')"/>
  51. <xsl:variable name="copyToWithHTMLExtension">
  52. <xsl:call-template name="replace-extension">
  53. <xsl:with-param name="filename" select="@copy-to"/>
  54. <xsl:with-param name="extension" select="$OUTEXT"/>
  55. </xsl:call-template>
  56. </xsl:variable>
  57. <xsl:variable name="urlID" select="$copyToWithHTMLExtension"/>
  58. <mapID target="{$targetID}" url="{$urlID}"/>
  59. </xsl:if>
  60. </xsl:if>
  61. </xsl:template>
  62. <!-- suppress default processing because title not used in JavaHelp map -->
  63. <xsl:template match="*[contains(@class,' map/topicref ')]" mode="title">
  64. <xsl:param name="isFirst"/>
  65. <xsl:param name="infile"/>
  66. <xsl:param name="nodeID"/>
  67. <xsl:param name="outfile"/>
  68. </xsl:template>
  69. </xsl:stylesheet>