Hi Rob,

From: "Robert Wilton -X (rwilton - ENSOFT LIMITED at Cisco)" <rwil...@cisco.com>
Date: Thursday, October 11, 2018 at 11:56 AM
To: "Reshad Rahman (rrahman)" <rrah...@cisco.com>
Cc: Martin Bjorklund <m...@tail-f.com>, "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [netmod] xpath expressions in JSON


<trimmed>

Yet the examples in section 8.3.6 don't seem to use namespace prefixes in very 
many places, e.g. why is it "/example-mod:event1/name='joe'" and not 
"/example-mod:event1/example-mod:name='joe'"?  Is the example wrong, or 
otherwise what am I missing? :-)


<RR> Section 8.3.6 of which document?
RFC 8040.

<RR2> B.3.6, got it. Was looking for 8.3.6, that’s why didn’t find it.

Regards,
Reshad.


Thanks,
Rob



Regards,
Reshad.

Thanks,
Rob











/martin







Thanks,

Rob





There is no standard XPath implementation that can just take an XML

instance document + YANG module and figure out what to do.  Custom

code is needed to connect things together.  This proposal doesn't

change this.





/martin





A normal XPath implementation will not find any namespace mapping for

the

prefixes.



An XPath expression has no concept of the "current module" inherited

from

the parent

like the JSON encoding. This is problematic for predicates



    /ietf-interfaces:interfaces/interface[name='eth0']



XPath says the missing prefixes for 'interface' and 'name' are simply

missing (no namespace).

The JSON encoding says "ietf-interfaces" is used for 'interfaces'. and

'interface'.

There is no specification for the 'name' node inside a predicate.



So you must mean the full module name will be used at every node:



  
/ietf-interfaces:interfaces/ietf-interfaces:interface[ietf-interfaces:name='eth0']







/martin





Andy





     Hmm, so you mean change the leaf "stream-xpath-filter" to say:



              o  The set of namespace declarations has one member for

each

                 YANG module supported by the server.  This member maps

                 from the YANG module name to the YANG module namespace.



                 This means that in the XPath expression, the module

name

                 serves as the prefix.



     .... and then also give an example of this.



     This is probably what we need to do in all places where

yang:xpath1.0

     is used, going forward.  Maybe even define a new type

     yang:xpath1.0-2 (name?) with the set of namespace declarations

     built-in.



We should avoid making off-the-shelf implementations of standards like

XPath unusable.

At the very least this should be only available if the server supports

it

(with a capability URI)







<RR> So we need an update to RFC7951?



Regards,

Reshad.





Andy





     /martin











     >

     > Lada

     >

     > >

     > > How is this supposed to work with JSON?

     > >

     > >

     > > /martin

     > >

     > > _______________________________________________

     > > netmod mailing list

     > > netmod@ietf.org<mailto:netmod@ietf.org>

     > > https://www.ietf.org/mailman/listinfo/netmod

     >

     > --

     > Ladislav Lhotka

     > Head, CZ.NIC Labs

     > PGP Key ID: 0xB8F92B08A9F76C67

     >



     _______________________________________________

     netmod mailing list

     netmod@ietf.org<mailto:netmod@ietf.org>

     https://www.ietf.org/mailman/listinfo/netmod





_______________________________________________

netmod mailing list

netmod@ietf.org<mailto:netmod@ietf.org>

https://www.ietf.org/mailman/listinfo/netmod



_______________________________________________

netmod mailing list

netmod@ietf.org<mailto:netmod@ietf.org>

https://www.ietf.org/mailman/listinfo/netmod

..



.







_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to