[yang-doctors] XPath question

Andy Bierman <andy@yumaworks.com> Mon, 06 June 2022 21:42 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 A64EAC15AAC1 for <yang-doctors@ietfa.amsl.com>; Mon, 6 Jun 2022 14:42:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.107
X-Spam-Level:
X-Spam-Status: No, score=-2.107 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, RCVD_IN_DNSWL_BLOCKED=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 9cEhn5ZcFN7i for <yang-doctors@ietfa.amsl.com>; Mon, 6 Jun 2022 14:42:42 -0700 (PDT)
Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) (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 A6DC8C14F729 for <yang-doctors@ietf.org>; Mon, 6 Jun 2022 14:42:42 -0700 (PDT)
Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-30c1c9b9b6cso156374237b3.13 for <yang-doctors@ietf.org>; Mon, 06 Jun 2022 14:42:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=jN4FT6EEgBwXQRANCI4G/csp8jVSkthHkP6qk16QM7A=; b=clCdrWuwvpJPv28X9y7LVo+k3PcyHBN+zYB87RMMXFM8iceH5aWU2kTQyH2XGr6RIG sJgxEu2FeldOu9F1HZgWvxlUcUna3IZ26XqPK0TKINFlr+YYNbZErRNfKcmM+QbQBlGp ffMGueXr47Oo3bHaklOyr5WKxK6jw4ecREPuVv0Pex5Tgr7RXGnkRDFqGjLXFMIy/2Ak E6Ln31wTA0dFeCHbw03kS0eoClrRHjg7+IJSksQLvpKjyiG20CMse3TgfBPeQ0/zVPdz Gcds2bjicx6i4ntsKJlrs/kZ1GUG4tCQXNQDzeV6oevnrLw21pnuiSKPxCGmgXpOD+nE BAnA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=jN4FT6EEgBwXQRANCI4G/csp8jVSkthHkP6qk16QM7A=; b=ar/MTDNgcO2F5muETUbYrBTp7thh5l5myBU1+CCOH6dZZ9LpRgR5aDMSoH7V5PLwSW 5n7wooRlhQ3SpewfhUPqD3tFDCidizHmAXotMTyCBwodK3TZWfVVYicsFiBaiIOeH3+/ suV21Bl98RDZBf/V2e+NO3znx59itzMxVMif5BOv791RozqBpzpfWmDq0mRfY04sD6Fa Yo0GR5YbmMStEhIX55ObtEmulmojxfXXYkX7qXKJJm5DHuiIoFtOYlM9iiU9nshQMzqJ eRB1v7JUaB6X+aIusdFL0XrigkqVTqg+OikKLTqSt1nExcyo0+4NqpwMuTXV+r7IJZzP xY7w==
X-Gm-Message-State: AOAM530JH11CWS6S22hDLgw0zuySPEG6OGShVKYknNqCReC+yU5izSVy Hhdd3QqVrAf3GFCX+vbOqEUdl7LRXkLjVDM4H8/XxxZZ2Tpv/g==
X-Google-Smtp-Source: ABdhPJztgjuGkrCh2ItN77yXWwxAcM9cxaw0H950HQtUacEBw0ePhOrA2DrZtiFrouHrnyNGDPfSpCTogdMOt/YmWFU=
X-Received: by 2002:a81:1997:0:b0:30c:3bbd:6016 with SMTP id 145-20020a811997000000b0030c3bbd6016mr28025101ywz.212.1654551761366; Mon, 06 Jun 2022 14:42:41 -0700 (PDT)
MIME-Version: 1.0
From: Andy Bierman <andy@yumaworks.com>
Date: Mon, 06 Jun 2022 14:42:30 -0700
Message-ID: <CABCOCHQuBzG=e=VM+sxj9ACmar=DVeKDD=JYCP86LAXAvjBZyQ@mail.gmail.com>
To: YANG Doctors <yang-doctors@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000ffc6cf05e0ce59dd"
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/DjnqC0Muv1KgLmGhfFym6AaP3TI>
Subject: [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:42:46 -0000

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