Honeynode test tool
[transportpce.git] / tests / honeynode / honeynode-plugin-impl / src / main / resources / honeycomb-minimal-resources / config / device / NamespaceTrimmer.xslt
1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
2     <xsl:template match="*/*/*" name="nodes">
3         <xsl:element name="{local-name()}">
4             <xsl:apply-templates select="@*|node()" />
5         </xsl:element>
6     </xsl:template>
7     <xsl:template match="*/*/*/*">
8         <xsl:if test="not(name(.)='type' or name(.)='lldp' or name(.)='ethernet' or name(.)='ots')">
9             <xsl:element name="{local-name()}">
10                 <xsl:apply-templates select="@*|node()" />
11             </xsl:element>
12         </xsl:if>
13         <xsl:if test="name(.)='type'" xmlns="http://org/openroadm/device">
14             <type xmlns:openROADM-if="http://org/openroadm/interfaces">
15                 <xsl:apply-templates select="@*|node()"/>
16             </type>
17         </xsl:if>
18         <xsl:if test="name(.)='ots'">
19             <ots xmlns="http://org/openroadm/optical-transport-interfaces">
20                 <xsl:apply-templates select="@*|node()"/>
21             </ots>
22         </xsl:if>
23         <xsl:if test="name(.)='lldp'">
24             <lldp xmlns="http://org/openroadm/lldp">
25                 <xsl:apply-templates select="@*|node()"/>
26             </lldp>
27         </xsl:if>
28         <xsl:if test="name(.)='ethernet'">
29             <ethernet xmlns="http://org/openroadm/ethernet-interfaces">
30                 <xsl:apply-templates select="@*|node()"/>
31             </ethernet>
32         </xsl:if>
33     </xsl:template>
34     <xsl:template match="/">
35         <org-openroadm-device xmlns="http://org/openroadm/device">
36             <xsl:apply-templates select="*"/>
37         </org-openroadm-device>
38     </xsl:template>
39 </xsl:stylesheet>