vty: Merge from a generic section in case no specific one exists

This commit is contained in:
Holger Hans Peter Freyther 2012-07-25 17:33:18 +02:00
parent e89ad6d1dd
commit 317aee5878
1 changed files with 11 additions and 2 deletions

View File

@ -27,12 +27,21 @@
<!-- Copy command and add nodes --> <!-- Copy command and add nodes -->
<xsl:template match="vty:command"> <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:copy>
<xsl:apply-templates select="@*|node()" /> <xsl:apply-templates select="@*|node()" />
<xsl:variable name="info" select="document($with)/vty:vtydoc/vty:node[@id=current()/../@id]/vty:command[@id=current()/@id]/." />
<!-- Copy the specific issue... -->
<xsl:for-each select="$info/*"> <xsl:for-each select="$info/*">
<xsl:copy-of select="." /> <xsl:copy-of select="." />
</xsl:for-each> </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:copy>
</xsl:template> </xsl:template>
</xsl:transform> </xsl:transform>