summaryrefslogtreecommitdiffstats
path: root/doc/vty/merge_doc.xsl
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-11-18 23:14:24 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-07-25 11:58:58 +0200
commit8297c819e985ba0d46752971b274b174098afceb (patch)
tree51ac1f236957dfa6c1ce45574f25c6b875eef822 /doc/vty/merge_doc.xsl
parentaa5d0e88944fe3258260aedfbce9101301e35b44 (diff)
vty: Add xsd and a command that can generate the documentation.
When building the doxygen documentation do not remove the other VTY documentation files in the doc/vty folder. Create a command that can be installed to dump all nodes and commands as XML on the given VTY. Create a schema for the XML file and a XSL-T script that can merge the generated file with additional information.
Diffstat (limited to 'doc/vty/merge_doc.xsl')
-rw-r--r--doc/vty/merge_doc.xsl37
1 files changed, 37 insertions, 0 deletions
diff --git a/doc/vty/merge_doc.xsl b/doc/vty/merge_doc.xsl
new file mode 100644
index 00000000..6e1bab1d
--- /dev/null
+++ b/doc/vty/merge_doc.xsl
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:vty="urn:osmocom:xml:libosmocore:vty:doc:1.0">
+ <xsl:output method="xml" version="1.0" encoding="ISO-8859-1" indent="yes" />
+ <xsl:variable name="with" select="'additions.xml'" />
+
+ <xsl:template match="@*|node()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()" />
+ </xsl:copy>
+ </xsl:template>
+
+
+ <!-- Copy the name of the node -->
+ <xsl:template match="vty:node">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()" />
+ <xsl:variable name="info" select="document($with)/vty:vtydoc/vty:node[@id=current()/@id]/." />
+ <xsl:for-each select="$info/vty:name">
+ <xsl:copy-of select="." />
+ </xsl:for-each>
+ </xsl:copy>
+ </xsl:template>
+
+
+ <!-- Copy command and add nodes -->
+ <xsl:template match="vty:command">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()" />
+ <xsl:variable name="info" select="document($with)/vty:vtydoc/vty:node[@id=current()/../@id]/vty:command[@id=current()/@id]/." />
+ <xsl:for-each select="$info/*">
+ <xsl:copy-of select="." />
+ </xsl:for-each>
+ </xsl:copy>
+ </xsl:template>
+</xsl:transform>
+