Re: [netmod] leaf-list and subtree filtering

Andy Bierman <> Sun, 25 January 2009 20:14 UTC

Return-Path: <>
Received: from [] (localhost []) by (Postfix) with ESMTP id 2ADC43A6A86; Sun, 25 Jan 2009 12:14:10 -0800 (PST)
Received: from localhost (localhost []) by (Postfix) with ESMTP id 913443A6A97 for <>; Sun, 25 Jan 2009 12:14:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.282
X-Spam-Status: No, score=-2.282 tagged_above=-999 required=5 tests=[AWL=-0.017, BAYES_00=-2.599, IP_NOT_FRIENDLY=0.334]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id fjtogqoe6Dgf for <>; Sun, 25 Jan 2009 12:14:07 -0800 (PST)
Received: from ( []) by (Postfix) with SMTP id D96153A6A86 for <>; Sun, 25 Jan 2009 12:14:07 -0800 (PST)
Received: (qmail 50058 invoked from network); 25 Jan 2009 20:13:50 -0000
Received: from unknown (HELO ? (andy@ with plain) by with SMTP; 25 Jan 2009 20:13:49 -0000
X-YMail-OSG: G3FGMQUVM1kFaSCD8EzFi3BqC5BfQcm32a8m0d.bvyKCSUPhXfz.PYrC93823Xe6PpRqMN2Bj9V37PUz1r6dffBGw8WX6Sbp8NjyUjOYye1xpbRNY5qxhf_9kBm9aO5CU.exAAuiuZ8PkPNWYB7XpaC5l7ooiWLy1Zw_S_nLqoga1e6Dyd7EUOFDvlYl.z.PdvfzY5w.VuatvGc0TFapug--
X-Yahoo-Newman-Property: ymail-3
Message-ID: <>
Date: Sun, 25 Jan 2009 12:13:47 -0800
From: Andy Bierman <>
User-Agent: Thunderbird (Windows/20081209)
MIME-Version: 1.0
To: Martin Bjorklund <>
References: <> <>
In-Reply-To: <>
Subject: Re: [netmod] leaf-list and subtree filtering
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: NETMOD WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"

Martin Bjorklund wrote:
> Hi,
> Andy Bierman <> wrote:
>>    <rpc>
>>      <get>
>>        <filter>
>>          <foo>fred</foo>
>>        </filter>
>>      </get>
>>    </rpc>
>>    <config>
>>      <foo>fred</foo>
>>      <foo>barney</foo>
>>      <foo>wilma</foo>
>>    </config>
>>    <rpc-reply>
>>      <data></data>
>>    </rpc-reply>
>> This example shows a leaf-list at the top-level.
>> Since the content-match tests are AND-ed together,
>> any non-match cancels out all the siblings.
> I don't agree.  Since there is a node in the data store that matches
> the content match node <foo>fred</foo>, all sibling nodes at this
> level are selected.

 From RFC 4741, 6.2.5:

    A leaf node that contains simple content is called a "content match
    node".  It is used to select some or all of its sibling nodes for
    filter output, and it represents an exact-match filter on the leaf
    node element content.  The following constraints apply to content
    match nodes:

    o  A content match node must not contain nested elements (i.e., must
       resolve to a simpleType in the XML Schema Definition (XSD)).

    o  Multiple content match nodes (i.e., sibling nodes) are logically
       combined in an "AND" expression.

This 2nd bullet needs to be clarified in 4741-bis.
It is confusing whether it means that every
content match (CM) node which matches the QName of CM node
must also match in content as well, or if it means
that at least one match of the CM node QName must contain
the specified value (and just that leaf-list node
is selected, since they are all unique in value).

I do not think the RFC is clear on this issue at all.

I get it that multiple content match node tests are
AND-ed together. That is all the 2nd bullet addresses.


It's fine with me to interpret the intended behavior
as "at least one instance" of each CM node must match
the content of the CM node, not "every instance" must match.
That is more useful.  The current RFC is silent
on this issue, so 4741-bis should have some text added
to fix it.

> content-match siblings are AND-ed together, but in this example there
> is just one node (no siblings in the filter).
>> The value of a leaf list vs. an XSD list
>> is more apparent with XPath filtering,
>> because tests like "*[foo='fred']" can
>> select a parent node if 'fred' is a member
>> of the child leaf-list <foo>.
> 5.2.5 of 4741 explicitly states that subtree filtering does not
> support (XSD) list content.
> /martin


netmod mailing list