"Dale R. Worley" <[email protected]> writes: > A difficulty I have with the current wording is that it doesn't point > out the crucial fact about leafref that the XPath expression can only > select elements that are instantiations of one particular data node. I > don't know XPath, but it seems that that is not a general property of > XPath expressions, you seem to be able to write XPath expressions that > select heterogenous groups of elements. So it's worth pointing out that > the allowed XPath expressions can't do that, and that is because of the > restriction that the expression must match path-arg.
Right, this is the slightly hand-waving part that I also objected to. An XPath expression in a leafref's "path" statement indeed selects a node set from an instance data tree. The node seet can be empty, but if it is non-empty, all its members necessarily have the same type, which is defined in a certain "leaf" schema node. The relationship is relatively straightforward but difficult to explain concisely. One basically has to follow the steps in the XPath expression, ignore all path-predicates, and skip all schema nodes that aren't data nodes (i.e., "choice" and "case" nodes). > > Perhaps my problem is that XPath is almost always used in this style, > and so the limitations in leafref aren't anything unusual. Actually, no, XPath expressions always have to be evaluated in the context of a specific instance XML document, they cannot directly address schema nodes. XPath 1.0 spec says: "XPath is a language for addressing parts of an XML document, ...". Lada > > Dale > > _______________________________________________ > 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
