> On 23 Nov 2015, at 13:19, Martin Bjorklund <[email protected]> wrote:
>
> Hi,
>
> derived-from is defined as:
>
> boolean derived-from(node-set nodes,
> string module-name,
> string identity-name)
>
> The derived-from() function returns true if the first node in
> document order in the argument "nodes" is a node of type
> identityref, and its value is an identity that is derived from the
> identity "identity-name" defined in the YANG module "module-name";
> otherwise it returns false.
>
>
> The "first node in the node set" doesn't work well with leaf lists. I
> suggest this change:
>
> NEW:
>
> The derived-from() function returns true if any node in
> the argument "nodes" is a node of type
> identityref, and its value is an identity that is derived from the
> identity "identity-name" defined in the YANG module "module-name";
> otherwise it returns false.
This makes sense. In fact, other XPath functions (deref() and enum-value()) are
also defined using "the first node in document order". This seems to be at odds
with sec. 6.4 that says: "This means that XPath expressions in YANG modules
SHOULD not rely on any specific document order." Is it OK that the result of
such functions is undefined if the node-set argument contains multiple nodes?
Lada
>
>
> (and similar for derived-from-or-self)
>
>
> As an example, consider this model:
>
> leaf-list yang-protocol {
> type identityref {
> base yang-protocol;
> }
> }
>
> and this query:
>
> /modules/module[not derived-from-or-self(restricted-protocol,
> "ietf-yang-library",
> "netconf-1.1")]
>
>
>
> /martin
>
> _______________________________________________
> netmod mailing list
> [email protected]
> https://www.ietf.org/mailman/listinfo/netmod
--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod