Re: [yang-doctors] XPath question

Andy Bierman <andy@yumaworks.com> Mon, 06 June 2022 21:55 UTC

Return-Path: <andy@yumaworks.com>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 99CE5C15AAC0 for <yang-doctors@ietfa.amsl.com>; Mon, 6 Jun 2022 14:55:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.108
X-Spam-Level:
X-Spam-Status: No, score=-2.108 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5IBuAPnHkGhA for <yang-doctors@ietfa.amsl.com>; Mon, 6 Jun 2022 14:55:55 -0700 (PDT)
Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 80BC8C14CF12 for <yang-doctors@ietf.org>; Mon, 6 Jun 2022 14:55:55 -0700 (PDT)
Received: by mail-yb1-xb35.google.com with SMTP id i39so3512ybj.9 for <yang-doctors@ietf.org>; Mon, 06 Jun 2022 14:55:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=YZnXRz4biPCKH/6siAXe5SNvAO+C9EhzE+QmTrlW/D0=; b=jLpkT8f9Un/bTrzKjDk5TAPpknUw7+4YNELfD83jt0WHGp5N+wxzj4L7loTrWIGMeS NSY3+fP0WDV82chMe2sKnlrLuAQnKDpJ8lISi1FVRHmRAGyLoKu0PtMXGreszHn89iht 1PfDlE3JXfPRApQTauP5h2o8zcyHDLiFeSjLXfgShkXEu1TgOJfaD5D05LmXOk0ImdIi Oq7s5zsKfRpij3zSS/PXFtbJMlGDPagMKQxbBhjsGtZewfpohH2gY7lNP5djH40Q2UQS POl8AcfnNe6tWw/bwZ7uMW9Ouzm1TmORmuiQwGArFwywWdYxQmVVppsT08PQXxK7dHeP MUEg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=YZnXRz4biPCKH/6siAXe5SNvAO+C9EhzE+QmTrlW/D0=; b=nrl3fbDvpol8iboAQRLzSfKzRCtbQGWxbBIfYDexcgDJw9Ljyl5hsJvyiUzx2W6Q/e Z6Dhu3Nm9Q9Ifv35EoEH2oEN3y9GBQIEIgsY9q1l9Ge/rtLUiU8NIa3Zymdeqa3FzTzG bt+4GUoOwL5Mfq89GVeObb2ZQi9OUrZFwiaSyDIk+Fmuy81T9Jtb0ayrLlBioKdA60Nz IGbsyPhMs4qCuPVi/6MuDJjguKnseE80ZIRim0zCsaosD5JXPoo/0O5wuqP7M5Xt5io3 DkFKWO9uhx+nOlL+3q5QEyc4DRHFxG4zpnNdTP7xQihBKyeV2YC5H+njmfI39GxhAI4u WQOg==
X-Gm-Message-State: AOAM533a36uuLodw5HIO3LFg+Udxz2u2YrnHSxyq1BYxxK4D5eBFnVm8 OcMu2rEtvZHdLe6Dzv6md8APFumQW8eIv/b9ClvPfQzcbfv/MQ==
X-Google-Smtp-Source: ABdhPJzR8lc1GYzSYqD6KcEQC4zh3D8+AHvuFXv782Fdw8DQgD1nkCa1XibOFKoiVoZT/a+SEP5boitNxOn3Sh/JgEA=
X-Received: by 2002:a25:cb0c:0:b0:663:6bac:92cc with SMTP id b12-20020a25cb0c000000b006636bac92ccmr10162771ybg.336.1654552554432; Mon, 06 Jun 2022 14:55:54 -0700 (PDT)
MIME-Version: 1.0
References: <CABCOCHQuBzG=e=VM+sxj9ACmar=DVeKDD=JYCP86LAXAvjBZyQ@mail.gmail.com>
In-Reply-To: <CABCOCHQuBzG=e=VM+sxj9ACmar=DVeKDD=JYCP86LAXAvjBZyQ@mail.gmail.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Mon, 06 Jun 2022 14:55:43 -0700
Message-ID: <CABCOCHTmeSQ0ZNgyBXSd02DYR=v9FSJKqX8eO+aA2ntt1bZHpQ@mail.gmail.com>
To: YANG Doctors <yang-doctors@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000045035205e0ce891e"
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/dimytlWs82cT8eoYnvkVLCfPRBM>
Subject: Re: [yang-doctors] XPath question
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 06 Jun 2022 21:55:59 -0000

Hi,

This is the key line:

7.9 <https://datatracker.ietf.org/doc/html/rfc7950#section-7.9>.  The
"choice" Statement

   The "choice" statement defines a set of alternatives, only one of
   which may be present in any one data tree.  The argument is an
   identifier, followed by a block of substatements that holds detailed
   choice information.  The identifier is used to identify the choice
   node in the schema tree.  A choice node does not exist in the data
   tree.

   A choice consists of a number of branches, each defined with a "case"
   substatement.  Each branch contains a number of child nodes. * The
   nodes from at most one of the choice's branches exist at the same
   time.*


The term 'node': Does it mean 'schema node' or 'data node'?

Andy


On Mon, Jun 6, 2022 at 2:42 PM Andy Bierman <andy@yumaworks.com> wrote:

> Hi,
>
> RFC 7950 does not say whether unselected case-stmts are visible in XPath.
> The bbf-qos-enhanced-scheduling module has a default leaf in 1 case
> and a nested node with a must-stmt in a sibling case that references it.
>
> The issue is whether the XPath context includes the default leaf.
> Case 'queue' and 'child-schedular-queues' are siblings.
> I suspect our code is wrong and the defaults from all cases are visible
> to XPath evaluation.
>
>
>           case queue {
>             description
>               "The children are a list of queues.";
>             leaf contains-queues {
>               type boolean;
>               *default "true";*
>               description
>                 "Indicates the scheduler contains queues.";
>             }
>             uses bbf-qos-tm:queues;
>           }
>           case child-scheduler-queues {
>             if-feature "child-scheduler-queue-references";
>             container child-scheduler-queues {
>               description
>                 "Configuration to reference one or more queues within
>                  one or more child schedulers.";
>               list child-scheduler {
>
>                  // ....
>
>                 container queues {
>
>
> * must "../../../../bbf-qos-sched:scheduler-node"                     +
> "[bbf-qos-sched:name=current()/../name]/"                     +
> "bbf-qos-sched:contains-queues = 'true'" *{
>                     error-message
>                       "The referenced scheduler must contain queues.";
>                     description
>                       "The referenced scheduler must contain queues
>                        in order for queues to be referenced.";
>                   }
>
>
>
> Andy
>
>