blob: 58f2fc7ef31d341ca6eda8bf1a6aa364a57f4012 [file] [log] [blame]
Ilya Moiseenkob4aca052013-10-06 15:10:19 -07001<xsl:stylesheet version = '1.0'
2 xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
3
4<xsl:template match="/ndnd">
5<fibs>
Alexander Afanasyevb9024d12013-10-14 18:10:18 +03006<xsl:apply-templates select="forwarding/fentry/dest" />
Ilya Moiseenkob4aca052013-10-06 15:10:19 -07007</fibs>
8</xsl:template>
9
Alexander Afanasyevb9024d12013-10-14 18:10:18 +030010<xsl:template match="dest">
Ilya Moiseenkob4aca052013-10-06 15:10:19 -070011<fib>
Alexander Afanasyevb9024d12013-10-14 18:10:18 +030012<xsl:apply-templates select="faceid" />
13<prefix><xsl:value-of select="../prefix"/></prefix>
Ilya Moiseenkob4aca052013-10-06 15:10:19 -070014</fib>
15</xsl:template>
16
17<xsl:template match="faceid">
18<xsl:variable name="id"><xsl:value-of select="." /></xsl:variable>
19<faceID><xsl:copy-of select="$id" /></faceID>
20<ip>
21<xsl:choose>
22 <xsl:when test="count(//face/ip[../faceid=$id]) &gt; 0"><xsl:value-of select="//face/ip[../faceid=$id]" />
23 </xsl:when>
24 <xsl:otherwise>app</xsl:otherwise>
25</xsl:choose>
26</ip>
27</xsl:template>
28
29</xsl:stylesheet>