diff options
author | Luca Melette <luca@srlabs.de> | 2013-12-20 19:18:32 +0100 |
---|---|---|
committer | Luca Melette <luca@srlabs.de> | 2013-12-20 19:18:32 +0100 |
commit | e0fbb2a75798c50bc9eb67158d3451b8e3a749d6 (patch) | |
tree | c627cc8e48c282e33e564873b68592196dc21578 /src/shared/libosmocore/doc/vty/merge_doc.xsl | |
parent | d5e88fa073de88dd3aca257af159b8d5d5dabe7d (diff) | |
parent | bf83e024a6f34ff8185e15d7fd5f1291c7453fe7 (diff) |
Merge branch 'master' into luca/catcher
Diffstat (limited to 'src/shared/libosmocore/doc/vty/merge_doc.xsl')
-rw-r--r-- | src/shared/libosmocore/doc/vty/merge_doc.xsl | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/shared/libosmocore/doc/vty/merge_doc.xsl b/src/shared/libosmocore/doc/vty/merge_doc.xsl new file mode 100644 index 00000000..caea1103 --- /dev/null +++ b/src/shared/libosmocore/doc/vty/merge_doc.xsl @@ -0,0 +1,48 @@ +<?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="UTF-8" indent="yes" /> + + + <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:variable name="info" select="document($with)/vty:vtydoc/vty:node[@id=current()/@id]/." /> + <xsl:if test="not($info/vty:hide)"> + <xsl:copy> + <xsl:apply-templates select="@*|node()" /> + <xsl:for-each select="$info/*"> + <xsl:copy-of select="." /> + </xsl:for-each> + </xsl:copy> + </xsl:if> + </xsl:template> + + + <!-- Copy command and add nodes --> + <xsl:template match="vty:command"> + <xsl:variable name="info" select="document($with)/vty:vtydoc/vty:node[@id=current()/../@id]/vty:command[@id=current()/@id]/." /> + <xsl:variable name="info_generic" select="document($with)/vty:vtydoc/vty:common/vty:command[@id=current()/@id]/." /> + <xsl:copy> + <xsl:apply-templates select="@*|node()" /> + + <!-- Copy the specific issue... --> + <xsl:for-each select="$info/*"> + <xsl:copy-of select="." /> + </xsl:for-each> + + <xsl:if test="not($info)"> + <xsl:for-each select="$info_generic/*"> + <xsl:copy-of select="." /> + </xsl:for-each> + </xsl:if> + </xsl:copy> + </xsl:template> +</xsl:transform> + |