Subject: Re: [netmod] I-D Action: draft-ietf-netmod-rfc6020bis-07.txt

From: Martin Bjorklund <[email-masked]>
Date: Tue, 13 Oct 2015 14:40:06 +0200 (CEST)

Hi,

As discussed in the meeting yesterday, here is the proposed text to
cover the when context node and accessible tree issue:

Changed text in 7.25.1:

   The XPath expression is conceptually evaluated in the following
   context, in addition to the definition in Section 6.4.1:

   o  If the "when" statement is a child of an "augment" statement, then
      the context node is the augment's target node in the data tree, if
      the target node is a data node.  Otherwise, the context node is
      the closest ancestor node to the target node that is also a data
      node.  If no such node exists, the context node is the root node.
      The accessible tree is tentatively altered during the processing
      of the XPath expression by removing all instances (if any) of the
      nodes added by the "augment" statement.

   o  If the "when" statement is a child of a "uses", "choice", or
      "case" statement, then the context node is the closest ancestor
      node to the "uses", "choice", or "case" node that is also a data
      node.  If no such node exists, the context node is the root node.
      The accessible tree is tentatively altered during the processing
      of the XPath expression by removing all instances (if any) of the
      nodes added by the "uses", "choice", or "case" statement.

   o  If the "when" statement is a child of any other data definition
      statement, the accessible tree is tentatively altered during the
      processing of the XPath expression by replacing all instances of
      the data node for which the "when" statement is defined with a
      single dummy node with the same name, but with no value and no
      children.  If no such instance exists, the dummy node is
      tentatively created.  The context node is this dummy node.

/martin

Ladislav Lhotka <[email-masked]> wrote:
> Randy Presuhn <[email-masked]> writes:
> 
> > Hi -
> >
> >>From: Martin Bjorklund <[email-masked]>
> >>Sent: Sep 28, 2015 3:15 AM
> >>To: [email-masked]
> >>Cc: [email-masked]
> >>Subject: Re: [netmod] I-D Action: draft-ietf-netmod-rfc6020bis-07.txt
> > ...
> >>Ok; the intention was "replace if it exists, and create otherwise"
> >>(i.e., "replace" as in NETCONF edit operation).   We can make this
> >>explicit:
> >>
> >>NEW:
> >>
> >>- If the "when" statement is a child of any other data definition
> >>  statement, the accessible tree is tentatively altered during the
> >>  processing of the XPath expression by replacing all instances of the
> >>  data node for which the "when" statement is defined with a single
> >>  dummy node with the same name, but with no value and no children.
> >>  If no instances of the data node exists, the dummy node is created.
> >>  The context node is this dummy node.
> >
> > A standard should avoid prescribing a specific implementation
> > strategy, and should instead limit itself to describing what
> > the observable behaviours of the relevant interfaces must be.
> 
> "when" statement relies on XPath but in some situations context for
> XPath evaluation is not properly defined. The proposed solution to
> Issue Y18 tries to alleviate this problem by defining tentative
> manipulations to XML infoset that provide the necessary context.
> 
> I am not particularly happy with this solution but still it is IMO
> better than hand-waving. I think "when" statement is a problematic
> inovation over standard XML schema languages because it defies
> grammar-based validation.
> 
> Lada
> 
> >
> > Randy
> >
> >
> > _______________________________________________
> > netmod mailing list
> > [email-masked]
> > https://www.ietf.org/mailman/listinfo/netmod
> 
> -- 
> Ladislav Lhotka, CZ.NIC Labs
> PGP Key ID: E74E8C0C
> 
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod