Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 79 lines (64 sloc) 2.179 kb
d5457c9 @LorenzMeier Updated documentation, re-introduced quad messages
LorenzMeier authored
1 <?php
c595939 Added PHP file generating HTML documentation out of the mavlink.xml spec
pixhawk authored
2
3 // Requires the installation of php5-xsl
4 // e.g. on Debian/Ubuntu: sudo apt-get install php5-xsl
5
6 // Load the file from the repository / server.
7 // Update this URL if the file location changes
8
d5457c9 @LorenzMeier Updated documentation, re-introduced quad messages
LorenzMeier authored
9 $xml_file_name = "https://raw.github.com/mavlink/mavlink/master/message_definitions/v1.0/common.xml";
c595939 Added PHP file generating HTML documentation out of the mavlink.xml spec
pixhawk authored
10
11 // Load the XSL transformation file from the repository / server.
12 // This file can be updated by any client to adjust the table
13
d5457c9 @LorenzMeier Updated documentation, re-introduced quad messages
LorenzMeier authored
14 $xsl_file_name= "https://raw.github.com/mavlink/mavlink/master/doc/mavlink_to_html_table.xsl";
c595939 Added PHP file generating HTML documentation out of the mavlink.xml spec
pixhawk authored
15
16 // Load data XML file
17 $xml = file_get_contents($xml_file_name);
18 $xml_doc = new DomDocument;
19 $xml_doc->loadXML($xml);
20
21 // Load stylesheet XSL file
22 $xsl = file_get_contents($xsl_file_name);
23 $xsl_doc = new DomDocument;
24 $xsl_doc->loadXML($xsl);
25
26 $xsltproc = new XsltProcessor();
27 $xsltproc->importStylesheet($xsl_doc);
d5457c9 @LorenzMeier Updated documentation, re-introduced quad messages
LorenzMeier authored
28 ?>
29
30 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
31 <html>
32 <head>
33 <title>MAVLINK Common Message set specifications</title>
34 <link rel="stylesheet" type="text/css" href="mavlink.css">
35 </head>
36 <body>
37 <h1>MAVLINK Common Message Set</h1>
38
39 <p>
40 These messages define the common message set, which is the reference message set implemented by most ground control stations and autopilots.
41 </p>
42
43 <?php
c595939 Added PHP file generating HTML documentation out of the mavlink.xml spec
pixhawk authored
44 // process the files and write the output to $out_file
45 if ($html = $xsltproc->transformToXML($xml_doc))
46 {
47 echo $html;
48 }
49 else
50 {
d5457c9 @LorenzMeier Updated documentation, re-introduced quad messages
LorenzMeier authored
51 trigger_error("XSL transformation failed",E_USER_ERROR);
c595939 Added PHP file generating HTML documentation out of the mavlink.xml spec
pixhawk authored
52 }
53
d5457c9 @LorenzMeier Updated documentation, re-introduced quad messages
LorenzMeier authored
54 ?>
c595939 Added PHP file generating HTML documentation out of the mavlink.xml spec
pixhawk authored
55
d5457c9 @LorenzMeier Updated documentation, re-introduced quad messages
LorenzMeier authored
56 <br />
57 <br />
c595939 Added PHP file generating HTML documentation out of the mavlink.xml spec
pixhawk authored
58
d5457c9 @LorenzMeier Updated documentation, re-introduced quad messages
LorenzMeier authored
59 <p>
60 Messages are defined by the <a href="https://raw.github.com/mavlink/mavlink/master/message_definitions/v1.0/common.xml">common.xml</a> file. The C packing/unpacking code is generated from this specification, as well as the HTML documentaiton in the section above.<br />
c595939 Added PHP file generating HTML documentation out of the mavlink.xml spec
pixhawk authored
61 <br />
62 <i>The XML displayed here is updated on every commit and therefore up-to-date.</i>
d5457c9 @LorenzMeier Updated documentation, re-introduced quad messages
LorenzMeier authored
63 </p>
64 </body>
65 </html>
66 <?php
c595939 Added PHP file generating HTML documentation out of the mavlink.xml spec
pixhawk authored
67 //require_once("inc/geshi.php");
68 //$xml_file_name = "http://github.com/pixhawk/mavlink/raw/master/mavlink_standard_message.xml";
69 //
70 //// Load data XML file
71 //$xml = file_get_contents($xml_file_name);
72 //
73 //// Show the current code
74 //$geshi_xml = new GeSHi($xml, 'xml');
75 //$display_xml = $geshi_xml->parse_code();
76 //
77 //echo $display_xml;
78
d5457c9 @LorenzMeier Updated documentation, re-introduced quad messages
LorenzMeier authored
79 ?>
Something went wrong with that request. Please try again.