[email protected] (Dale R. Worley) writes:
> [...]
> Yes, it's difficult to explain, though once one gets the idea, it's
> straightforward enough. The problem I have is that it's not pointed out
> explicitly anywhere. (E.g., Juergen suggests section 9.9.2, but I don't
> see it there.)
>
> The crucial points seem to be:
>
> - The XPath expression is limited by the syntax "path-arg" and the rules
> in 9.9.2.
>
> - Because of those restrictions, there exists one data node in the
> schema such that: evalutating the expression for any leaf or
> leaf-list node in any data tree returns a set of nodes, all of which
> are instances of that one schema node.
Interestingly, there's a sort-of dependency on the fact that
grouping/uses can't be recursive. If I could define a general binary
tree data structure:
grouping tree-grouping {
container left-child {
uses tree-grouping;
}
container right-child {
uses tree-grouping;
}
leaf data1 {
type string;
}
leaf data2 {
type leafref {
path "../left-child/data1";
}
}
}
container a {
use tree-grouping;
container left-child {
leaf data1 {
type integer;
}
}
}
statically validating the leafref would take a clever algorithm, because
the parent element of a data2 element can be a left-child container, a
right-child container, or an 'a' container.
But since groupings cannot be instantiated recursively, the validator
can "macro expand" all 'uses' statements and then validate every
instance of the leaf data2; for each instance of data2, the parent
element is unique, making interpretation of the path simple.
Dale
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod