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.


(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
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to