Re: [netmod] XPath node type tests

2017-10-26 Thread Phil Shafer
Andy Bierman writes: >I think text() and node() are just filter tests. > > /foo/*[text()] would return all the child nodes of /foo that are leaf or >leaf-list > >text() returns a boolean (0 or 1). Do not use it for value testing: > > /foo/*[text() =3D 'fred'] // wrong! > > /foo/*[. =3D 'fred']

Re: [netmod] XPath node type tests

2017-10-23 Thread Martin Bjorklund
Ladislav Lhotka wrote: > > > On 23 Oct 2017, at 12:37, Martin Bjorklund wrote: > > > > Robert Wilton wrote: > >> > >> > >> On 23/10/2017 10:10, Martin Bjorklund wrote: > >>> Andy Bierman wrote: > On Fri, Oct 20, 2017 at 9:24 AM, Robert Wilton > wrote: > > > Hi Lada, > >

Re: [netmod] XPath node type tests

2017-10-23 Thread Ladislav Lhotka
> On 23 Oct 2017, at 12:37, Martin Bjorklund wrote: > > Robert Wilton wrote: >> >> >> On 23/10/2017 10:10, Martin Bjorklund wrote: >>> Andy Bierman wrote: On Fri, Oct 20, 2017 at 9:24 AM, Robert Wilton wrote: > Hi Lada, > > Thanks for the explanation, that makes

Re: [netmod] XPath node type tests

2017-10-23 Thread Martin Bjorklund
Robert Wilton wrote: > > > On 23/10/2017 10:10, Martin Bjorklund wrote: > > Andy Bierman wrote: > >> On Fri, Oct 20, 2017 at 9:24 AM, Robert Wilton > >> wrote: > >> > >>> Hi Lada, > >>> > >>> Thanks for the explanation, that makes sense. > >>> > >>> > >>> On 20/10/2017 16:27, Ladislav Lhotka w

Re: [netmod] XPath node type tests

2017-10-23 Thread Robert Wilton
On 23/10/2017 10:10, Martin Bjorklund wrote: Andy Bierman wrote: On Fri, Oct 20, 2017 at 9:24 AM, Robert Wilton wrote: Hi Lada, Thanks for the explanation, that makes sense. On 20/10/2017 16:27, Ladislav Lhotka wrote: Hi Rob, Robert Wilton writes: Hi, XPATH 1.0 defines the followi

Re: [netmod] XPath node type tests

2017-10-23 Thread Martin Bjorklund
Andy Bierman wrote: > On Fri, Oct 20, 2017 at 9:24 AM, Robert Wilton wrote: > > > Hi Lada, > > > > Thanks for the explanation, that makes sense. > > > > > > On 20/10/2017 16:27, Ladislav Lhotka wrote: > > > >> Hi Rob, > >> > >> Robert Wilton writes: > >> > >> Hi, > >>> > >>> XPATH 1.0 defines t

Re: [netmod] XPath node type tests

2017-10-20 Thread Andy Bierman
On Fri, Oct 20, 2017 at 9:24 AM, Robert Wilton wrote: > Hi Lada, > > Thanks for the explanation, that makes sense. > > > On 20/10/2017 16:27, Ladislav Lhotka wrote: > >> Hi Rob, >> >> Robert Wilton writes: >> >> Hi, >>> >>> XPATH 1.0 defines the following three node-type tests: >>> >>> 1) commen

Re: [netmod] XPath node type tests

2017-10-20 Thread Robert Wilton
Hi Lada, Thanks for the explanation, that makes sense. On 20/10/2017 16:27, Ladislav Lhotka wrote: Hi Rob, Robert Wilton writes: Hi, XPATH 1.0 defines the following three node-type tests: 1) comment() 2) processing-instruction() 3) text() For completeness, node() is the fourth one. My

Re: [netmod] XPath node type tests

2017-10-20 Thread Ladislav Lhotka
Hi Rob, Robert Wilton writes: > Hi, > > XPATH 1.0 defines the following three node-type tests: > > 1) comment() > 2) processing-instruction() > 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 'process

[netmod] XPath node type tests

2017-10-20 Thread Robert Wilton
Hi, XPATH 1.0 defines the following three node-type tests: 1) comment() 2) processing-instruction() 3) text() 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. However, it wasn't cle