06-29-2022 12:30 PM - edited 06-29-2022 01:32 PM
Hi
Devtools have an xpath eval option where xpath expressions can be tested. Really useful, but where those expressions actually work? In XML templates? They seem to not work in YANG as leafrefs or tailf:default-ref.
This is my situation:
admin@ncs(config-devices_service-test)# xpath eval deref(current()/device-model)/../bla_prefix:ned-versions[last()] /services/bla_prefix:bla/device-platform[model='ASR-1001-HX']/ned-versions :: 7.99.1.1
Disregard the hierarchy as it is specific to our yang models and slightly sanitized for public use. Point is, it works in CLI.
If I paste it in YANG (changing one level of reference to accommodate actual yang hierarchy CLI can't reach), model fails to compile:
error: bad argument value "deref(current()/../device-model)/../bla_prefix:ned-versions[last()]", should be of type extended-schema-nodeid
What am I missing? A setting or a tailf: option that I am not setting unknowingly? Or YANG 1.0 simply isn't as capable?
P.S. ned-version node I'm performing last() on is a leaf-list, and I am trying to use this expression in tailf:default-ref if that is important in any way.
Solved! Go to Solution.
06-29-2022 01:36 PM
06-29-2022 01:36 PM
06-30-2022 12:27 AM
I see. Bummer. Thanks for clarifying!
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