gen_references.xsl 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  2. <!--
  3. Copyright Andrey Semashev 2007 - 2017.
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENSE_1_0.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. This stylesheet extracts information about headers, classes, etc.
  8. from the Doxygen-generated reference documentation and writes
  9. it as QuickBook templates that refer to the according Reference sections.
  10. -->
  11. <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  12. <xsl:output method="text"/>
  13. <xsl:template match="/library-reference">
  14. <xsl:text disable-output-escaping="yes">[/
  15. Copyright Andrey Semashev 2007 - 2017.
  16. Distributed under the Boost Software License, Version 1.0.
  17. (See accompanying file LICENSE_1_0.txt or copy at
  18. http://www.boost.org/LICENSE_1_0.txt)
  19. This document is a part of Boost.Log library documentation.
  20. This document was automatically generated, DO NOT EDIT!
  21. /]
  22. </xsl:text>
  23. <xsl:apply-templates>
  24. <xsl:with-param name="namespace"/>
  25. <xsl:with-param name="enclosing_namespace"/>
  26. </xsl:apply-templates>
  27. </xsl:template>
  28. <!-- Skip any text nodes -->
  29. <xsl:template match="text()"/>
  30. <!-- Headers -->
  31. <xsl:template match="header">
  32. <xsl:param name="namespace"/>
  33. <xsl:param name="enclosing_namespace"/>
  34. [template <xsl:value-of select="translate(@name, '/.', '__')"/>[][headerref <xsl:value-of select="@name"/>]]
  35. <xsl:apply-templates>
  36. <xsl:with-param name="namespace" select="$namespace"/>
  37. <xsl:with-param name="enclosing_namespace" select="$enclosing_namespace"/>
  38. </xsl:apply-templates>
  39. </xsl:template>
  40. <!-- Namespaces - only needed to construct fully qualified class names -->
  41. <xsl:template match="namespace">
  42. <xsl:param name="namespace"/>
  43. <xsl:param name="enclosing_namespace"/>
  44. <xsl:variable name="namespace_prefix">
  45. <xsl:value-of select="$namespace"/><xsl:if test="string-length($namespace) &gt; 0"><xsl:text>::</xsl:text></xsl:if>
  46. </xsl:variable>
  47. <xsl:apply-templates>
  48. <xsl:with-param name="namespace" select="concat($namespace_prefix, @name)"/>
  49. <xsl:with-param name="enclosing_namespace" select="@name"/>
  50. </xsl:apply-templates>
  51. </xsl:template>
  52. <!-- Classses -->
  53. <xsl:template match="class|struct">
  54. <xsl:param name="namespace"/>
  55. <xsl:param name="enclosing_namespace"/>
  56. [template <xsl:value-of select="concat('class_', $enclosing_namespace, '_', @name)"/>[][classref <xsl:value-of select="concat($namespace, '::', @name)"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>]]
  57. <xsl:apply-templates>
  58. <xsl:with-param name="namespace" select="concat($namespace, '::', @name)"/>
  59. <xsl:with-param name="enclosing_namespace" select="concat($enclosing_namespace, '_', @name)"/>
  60. </xsl:apply-templates>
  61. </xsl:template>
  62. <!-- Free functions - currently disabled because multiple overloads generate duplicate QuickBook templates -->
  63. <!--
  64. <xsl:template match="function">
  65. <xsl:param name="namespace"/>
  66. <xsl:param name="enclosing_namespace"/>
  67. [template <xsl:value-of select="concat('func_', $enclosing_namespace, '_', @name)"/>[][funcref <xsl:value-of select="concat($namespace, '::', @name)"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>]]
  68. </xsl:template>
  69. -->
  70. </xsl:transform>