Hi Lada,

Thanks for the explanation, that makes sense.


On 20/10/2017 16:27, Ladislav Lhotka wrote:
Hi Rob,

Robert Wilton <[email protected]> writes:

Hi,

XPATH 1.0 defines the following three node-type tests:

1) comment()
2) processing-instruction(<opt arg>)
3) text()
For completeness, node() is the fourth one.

My assumption is that a YANG tree doesn't contain any nodes of type
'comment' or 'processing-instruction' and hence these filters would
never match any nodes.
Yes. FWIW, Yangson library raises NotSupported exception upon
encountering these.

However, it wasn't clear to me from reading 7950 or rfc6087bis-14
whether text() matches anything.  In particular, does a YANG leaf node
(except of type empty) always parent a text node that holds its value?
I believe this is how it should be interpreted. According to XPath 1.0
spec, comparisons like

     xyz = 'foo'

use string-value of xyz node, which is defined as the concatenation of
the string-values of all text node descendants of xyz.
Yes.  I don't think that I've ever come across for XPath usage in YANG where the "concatenation of the string-values of all text node descendants " is actually useful (particularly as the children nodes are likely to not be consistently ordered).

Thanks,
Rob



Lada

Thanks,
Rob



_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to