Hi Guys,
I m getting the following error after package reload in NSO
packages package l3cpe
oper-status file-load-error
oper-status error-info "l3cpe-template.xml:115 Unknown element: '{intf-type}' for ned-id: cisco-ios-cli-6.42:cisco-ios-cli-6.42"
Can you please help
Regards
Darpan
Solved! Go to Solution.
You cannot parametrize the XML tag itself. only its content:
This is what you have there at the moment:
<interface xmlns="urn:ios"> <{intf-type}> <name>{slot}</name> <ip> <no-address> <address>false</address> </no-address> </ip> </{intf-type}>
you'd need to have the same block for each interface type you want to support, and have that block conditional on the content of intf-type:
<interface xmlns="urn:ios"> <GigabitEthernet when="{/intf-type = 'GigabitEthernet'}"> <name>{/interface-id}</name> ... <interface xmlns="urn:ios"> <TenGigabitEthernet when="{/intf-type = 'TenGigabitEthernet'}"> <name>{/interface-id}</name> ...
You're trying to use the 'foreach' processing instruction, but you're not using the correct syntax.
Have a look at the NSO Development Guide - search for section "Processing instructions". You can find the syntax for the statement.
You were using something like this:
<interface xmlns="urn:ios" foreach="{interfaces}"> ... </interface>
instead, you should be using something like this:
<?foreach {/interfaces}?> <interface xmlns="urn:ios"> ... </interface> <?end?>
Finally, when troubleshooting, use 'commit dry-run outformat native | debug template '.
This will help you figure out what's not working.
What's on the line of the XML?
The zip file seems to be empty.
You cannot parametrize the XML tag itself. only its content:
This is what you have there at the moment:
<interface xmlns="urn:ios"> <{intf-type}> <name>{slot}</name> <ip> <no-address> <address>false</address> </no-address> </ip> </{intf-type}>
you'd need to have the same block for each interface type you want to support, and have that block conditional on the content of intf-type:
<interface xmlns="urn:ios"> <GigabitEthernet when="{/intf-type = 'GigabitEthernet'}"> <name>{/interface-id}</name> ... <interface xmlns="urn:ios"> <TenGigabitEthernet when="{/intf-type = 'TenGigabitEthernet'}"> <name>{/interface-id}</name> ...
You're trying to use the 'foreach' processing instruction, but you're not using the correct syntax.
Have a look at the NSO Development Guide - search for section "Processing instructions". You can find the syntax for the statement.
You were using something like this:
<interface xmlns="urn:ios" foreach="{interfaces}"> ... </interface>
instead, you should be using something like this:
<?foreach {/interfaces}?> <interface xmlns="urn:ios"> ... </interface> <?end?>
Finally, when troubleshooting, use 'commit dry-run outformat native | debug template '.
This will help you figure out what's not working.