37c56d46b762d2ab56f66ee32914cdcd33cab499
[sfa.git] / sfatables / processors / link / restrict_slice.xml
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3     <!-- Magic sauce copied from a manual. This fragment basically copies everything except for
4     stuff that explicitly matches with the templates defined below. In the case of such a match,
5     the matched node is treated differently.-->
6     <xsl:template match="@* | node()">
7         <xsl:copy>
8             <xsl:apply-templates select="@* | node()"/>
9         </xsl:copy>
10     </xsl:template>
11     <!-- End of magic sauce -->
12
13     <!-- Read in the value of the argument. See 'example_vini_rspec.xml' for an example of such an argument -->
14     <xsl:variable name="max-link-bandwidth" select="//RSpec//sfatables-rule/argument[name='max-link-bandwidth']/value"/>
15
16     <!-- Drop Linkspecs for which bw > max-link-bandwidth -->
17     <xsl:template match="LinkSpec">
18             <xsl:choose>
19                 <xsl:when test="bw &lt; $max-link-bandwidth">
20                     <xsl:copy-of select="."/>
21                 </xsl:when>
22                 <xsl:otherwise/>
23             </xsl:choose> 
24     </xsl:template>
25
26     <xsl:template match="sfatables-input"/>
27 </xsl:stylesheet>