Ilya Moiseenko | 69abb97 | 2013-11-04 16:02:20 -0800 | [diff] [blame] | 1 | <xsl:stylesheet version = '1.0' |
Ilya Moiseenko | 18c8a13 | 2013-10-24 01:52:52 -0700 | [diff] [blame] | 2 | xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> |
| 3 | |
| 4 | <xsl:template match="/ndnd"> |
| 5 | <fibs> |
| 6 | <xsl:apply-templates select="forwarding/fentry/dest" /> |
| 7 | </fibs> |
| 8 | </xsl:template> |
| 9 | |
| 10 | <xsl:template match="dest"> |
| 11 | <fib> |
| 12 | <xsl:apply-templates select="faceid" /> |
| 13 | <prefix><xsl:value-of select="../prefix"/></prefix> |
| 14 | </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]) > 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> |