07-21-2021 11:05 PM
Hi
When I was learning nano service, I found this expression in the nso example.
string(*[local-name()=$IFNAME])
I do not understand the meaning of ' *[local-name()=$IFNAME] '.
What is the meanings of the expression '*[ ....]' and the function ' local-name() '.
xml template file:
nso-5.5.5.2.3/examples.ncs/getting-started/developing-with-ncs/20-nano-services/packages/link/templates/link-template.xml
<devices xmlns="http://tail-f.com/ns/ncs"> <?foreach {endpoints}?> <?foreach {a-device|b-device}?> <?set IFNAME={substring(local-name(), 1, 1)}-interface?> <device> <name>{.}</name> <config> <sys xmlns="http://example.com/router"> <interfaces> <interface tags="merge"> <name>{string(*[local-name()=$IFNAME])}</name> <?set-context-node {..}?> <unit> <name>{unit}</name> <vlan-id>{vlan-id}</vlan-id> </unit> </interface> </interfaces> </sys> </config> </device> <?end?> <?end?> </devices> </config-template>
07-22-2021 09:48 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide