Subject: [netmod] XPath Data Model vs. YANG Data Model

From: Andy Bierman <[email-masked]>
Date: Wed, 07 Jan 2009 05:27:56 -0800

Hi,

We probably need to include some text on how the XPath data model
defined in section 5 of XPath 1.0 is applied to every
single NETCONF PDU or a NETCONF configuration database.

Sec. 5 is important because an implementor needs to
figure out what to do for the node tests in sec. 2.3.
None of these tests are really relevant to NETCONF,
and will not likely be supported.

The one test of interest is text(), this this matches
any leaf content (except type empty?). Since NETMOD
deals with elements only, it is not clear what to
do with this one.

The easiest thing to do is say all the tests except node()
always return false. (XPath defines node() to match anything.)

   comment()
   text()
   processing-instruction()
   node()

The namespace and attribute axis are probably going to
be empty in NETMOD implementations as well.

Andy

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

---

From: Martin Bjorklund <[email-masked]>
Date: Wed, 07 Jan 2009 15:37:47 +0100 (CET)

> deals with elements only, it is not clear what to

With YANG, leaf and leaf-list elements (only) will have text nodes.

For example:

   leaf foo {
       type string;
       must "./text() == 'bar'";
   }

is a (stupid) way to ensure that the leaf 'foo' always has the value
'bar'.

> always return false.

This would IMO really be a deviation from XPath.  text() should be
true for the text node of leafs!  Since we don't have comments and
processing instructions, these tests will obviously never match.

/martin

---

From: "tom.petch" <[email-masked]>
Date: Wed, 7 Jan 2009 16:34:09 +0100

----- Original Message -----
From: "Andy Bierman" <[email-masked]>
To: "NETMOD Working Group" <[email-masked]>
Sent: Wednesday, January 07, 2009 2:27 PM
Subject: [netmod] XPath Data Model vs. YANG Data Model

> single NETCONF PDU or a NETCONF configuration database.

Yes, I think that that is the crux of the issue, with the complication that a
data model in yang is not an XML document.  I am unclear just how far they
diverge but in so far as there is not a one to one (reversible) mapping, then
the application of XPath 1.0 to yang may not be determinate; which is a topic
that has come up several times, in one form of another, eg in having a canonical
order or not.  There may be several parts of XPath that we need to excise,
either because they make no sense or because they are too complex to make sense
of; which is perhaps what the rest of what Andy is saying is, although I need
more time to think about this.

Tom Petch

---

From: Andy Bierman <[email-masked]>
Date: Wed, 07 Jan 2009 09:05:37 -0800

> more time to think about this.

Certainly the use of XPath in the <get-config> and <get>
operations on NETMOD content is within scope.

Phil's approach is actually quite reasonable, which
is to define some aspects of YANG validation and
protocol behavior as implementation-specific.

A close reading of the document ordering reveals that
it is based on the first character of each node as they
appear in the XML instance document.  This serialized
character representation is not available inside the agent
database.  The relative position of data nodes within
a tree may not be in document order.

I just want to make sure the agent uses the same code
each time, so '//chapter[42]' yields the same result
on the same agent, on an unchanged database.

Andy