mavlink_to_html_table.xsl 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:template match="//include">
  4. <h1>MAVLink Include Files</h1>
  5. <p><strong><em>Including files: </em><xsl:value-of select="." /></strong></p>
  6. </xsl:template>
  7. <xsl:template match="//enums">
  8. <h1>MAVLink Type Enumerations</h1>
  9. <xsl:apply-templates />
  10. </xsl:template>
  11. <xsl:template match="//messages">
  12. <h1>MAVLink Messages</h1>
  13. <xsl:apply-templates />
  14. </xsl:template>
  15. <xsl:template match="//message">
  16. <a>
  17. <xsl:attribute name="name">
  18. <xsl:value-of select="@name"/>
  19. </xsl:attribute>
  20. </a>
  21. <h3 class="mavlink_message_name"><xsl:value-of select="@name" /> (
  22. <a>
  23. <xsl:attribute name="href">
  24. #<xsl:value-of select="@name"/>
  25. </xsl:attribute>
  26. #<xsl:value-of select="@id" />
  27. </a>
  28. )</h3>
  29. <p class="description"><xsl:value-of select="description" /></p>
  30. <table class="sortable">
  31. <thead>
  32. <tr>
  33. <th class="mavlink_field_header">Field Name</th>
  34. <th class="mavlink_field_header">Type</th>
  35. <th class="mavlink_field_header">Description</th>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. <xsl:apply-templates select="field" />
  40. </tbody>
  41. </table>
  42. </xsl:template>
  43. <xsl:template match="//field">
  44. <tr class="mavlink_field">
  45. <td class="mavlink_name" valign="top"><xsl:value-of select="@name" /></td>
  46. <td class="mavlink_type" valign="top"><xsl:value-of select="@type" /></td>
  47. <td class="mavlink_comment"><xsl:value-of select="." /></td>
  48. </tr>
  49. </xsl:template>
  50. <xsl:template match="//version">
  51. <h2 style="color:red;">MAVLink Documentation</h2>
  52. <p>
  53. The <a href="https://mavlink.io/en/messages/common.html">Official MAVLink message documentation</a> contains additional information, including field units and enum values.
  54. </p>
  55. <h2>MAVLink Protocol Version</h2>
  56. <p>The current MAVLink version is 2.<xsl:value-of select="." />. The minor version numbers (after the dot) range from 1-255. </p>
  57. </xsl:template>
  58. <xsl:template match="//enum">
  59. <a>
  60. <xsl:attribute name="name">
  61. ENUM_<xsl:value-of select="@name"/>
  62. </xsl:attribute>
  63. </a>
  64. <h3 class="mavlink_message_name"><xsl:value-of select="@name" /></h3>
  65. <p class="description"><xsl:value-of select="description" /></p>
  66. <table class="sortable">
  67. <thead>
  68. <tr>
  69. <th class="mavlink_field_header">Value</th>
  70. <th class="mavlink_field_header">Field Name</th>
  71. <th class="mavlink_field_header">Description</th>
  72. </tr>
  73. </thead>
  74. <tbody>
  75. <xsl:apply-templates select="entry" />
  76. </tbody>
  77. </table>
  78. </xsl:template>
  79. <xsl:template match="//entry">
  80. <tr class="mavlink_field" id="{@name}">
  81. <td class="mavlink_type" valign="top"><xsl:value-of select="@value" /></td>
  82. <td class="mavlink_name" valign="top"><xsl:value-of select="@name" /></td>
  83. <td class="mavlink_comment"><xsl:value-of select="description" /></td>
  84. </tr>
  85. <tr>
  86. <td></td>
  87. <xsl:apply-templates select="param" />
  88. </tr>
  89. <tr>
  90. <td colspan="3"><br /></td>
  91. </tr>
  92. </xsl:template>
  93. <xsl:template match="//param">
  94. <tr>
  95. <td></td>
  96. <td class="mavlink_mission_param" valign="top">Mission Param #<xsl:value-of select="@index" /></td>
  97. <td class="mavlink_comment"><xsl:value-of select="." /></td>
  98. </tr>
  99. </xsl:template>
  100. </xsl:stylesheet>