02-06-2012 01:46 AM
Hi,
I want to write commit script for MX240 series router for the below command:
set policy-options policy-statement VPN-A-export term a then community add VPN-A
The script I wrote is failing to execute. Can you please check and let me know whats wrong with this script ?
<?xml version="1.0" standalone="yes" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:junos="http://xml.juniper.net/junos/*/junos"
xmlns:xnm="http://xml.juniper.net/xnm/1.1/xnm"
xmlns:jcs="http://xml.juniper.net/junos/commit-scripts/1.0">
<xsl:import href="../import/junos.xsl"/>
<xsl:template match="configuration">
<change>
<policy-options>
<policy-statement>
<xsl:variable name="policyName" select="'VPN-A-export'"/>
<xsl:value-of select="$policyName"/>
<term>
<xsl:variable name="termName" select="'a'"/>
<xsl:value-of select="$termName"/>
<from>
<protocol>
<bgp/>
</protocol>
</from>
<then>
<community>
<add>
<route>
<name>VPN-A</name>
</route>
</add>
</community>
</then>
<then> <accept/> </then>
</term>
</policy-statement>
</policy-options>
</change>
</xsl:template>
</xsl:stylesheet>