Re: analysis of YANG vs. RELAX NG

"Rohan Mahy" <rohan.mahy@gmail.com> Wed, 28 November 2007 22:43 UTC

Return-path: <discuss-bounces@apps.ietf.org>
Received: from [127.0.0.1] (helo=stiedprmman1.va.neustar.com) by megatron.ietf.org with esmtp (Exim 4.43) id 1IxVdE-0007Dn-2O; Wed, 28 Nov 2007 17:43:48 -0500
Received: from discuss by megatron.ietf.org with local (Exim 4.43) id 1IxVdD-0007Dh-9a for discuss-confirm+ok@megatron.ietf.org; Wed, 28 Nov 2007 17:43:47 -0500
Received: from [10.91.34.44] (helo=ietf-mx.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1IxVdD-0007DZ-03 for discuss@apps.ietf.org; Wed, 28 Nov 2007 17:43:47 -0500
Received: from nz-out-0506.google.com ([64.233.162.235]) by ietf-mx.ietf.org with esmtp (Exim 4.43) id 1IxVdC-0007iU-Gc for discuss@apps.ietf.org; Wed, 28 Nov 2007 17:43:46 -0500
Received: by nz-out-0506.google.com with SMTP id v1so1093820nzb for <discuss@apps.ietf.org>; Wed, 28 Nov 2007 14:43:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=HnEssfXdDmXQmcsNRH9x9FHKHE8QKUP8VJlwChLBpxc=; b=jyUaS0bmM0U1Ln0MEEDhoJGwpOd1SajHhqYO5MIuRmXEnUYnIR+Ltx6g+zV9eTRkl2ljgBPoM42ZQCqan38HOBkpiWLJdi0vOyWglRzuQ1dn1bcjpWfqmrkejt7k0bLRaPMd2LGROt0JSXpAO+11KOMAHiU+mcl2juZTIn0Um34=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=pt4kvPKlyw01AQ1BrxF0JpLmdhxOghKAKLN+M8Gi4NJ3R1cMMphBVNUQeKk9wb8ihLZjgOJwzJkKYIaK6tnVyjbY70lr4/NnHRUB8mr9rlk/cZTIzVh3w7cc9ygKrJj1qWMSNEf5OYh1lKDcaf+uTP0ucweKzvxwYbYG0XPhcTs=
Received: by 10.142.127.10 with SMTP id z10mr395049wfc.1196289825196; Wed, 28 Nov 2007 14:43:45 -0800 (PST)
Received: by 10.142.214.15 with HTTP; Wed, 28 Nov 2007 14:43:45 -0800 (PST)
Message-ID: <953beacc0711281443h3624f486i96b30b9aa320e4f7@mail.gmail.com>
Date: Wed, 28 Nov 2007 14:43:45 -0800
From: "Rohan Mahy" <rohan.mahy@gmail.com>
To: "Martin Bjorklund" <mbj@tail-f.com>
Subject: Re: analysis of YANG vs. RELAX NG
In-Reply-To: <20071128.230244.254578150.mbj@tail-f.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_Part_6608_16830146.1196289825208"
References: <953beacc0711271504y7aea5f21jc301ccad886d3611@mail.gmail.com> <474D9194.3060103@ericsson.com> <953beacc0711281025w4d993dd7u77d729111074496c@mail.gmail.com> <20071128.230244.254578150.mbj@tail-f.com>
X-Spam-Score: 0.0 (/)
X-Scan-Signature: d185fa790257f526fedfd5d01ed9c976
Cc: discuss@apps.ietf.org
X-BeenThere: discuss@apps.ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: general discussion of application-layer protocols <discuss.apps.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/discuss>, <mailto:discuss-request@apps.ietf.org?subject=unsubscribe>
List-Post: <mailto:discuss@apps.ietf.org>
List-Help: <mailto:discuss-request@apps.ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/discuss>, <mailto:discuss-request@apps.ietf.org?subject=subscribe>
Errors-To: discuss-bounces@apps.ietf.org

Hi Martin,

On Nov 28, 2007 2:02 PM, Martin Bjorklund <mbj@tail-f.com> wrote:

> Hi,
>
> "Rohan Mahy" <rohan.mahy@gmail.com> wrote:
> > Setting that aside for a moment, even if half the statements in a schema
> are
> > annotation, the other half can still do something very, very useful.
>  They
> > can validate the syntax and structure of the XML received on the wire
> > automatically in a piece of code (the XML parser) that the
> implementation
> > probably already has.
>
> Note that in order to validate the different NETCONF messages, you
> would either need more than one schema, or a very lax schema which
> will validate messages/documents which are not actually valid NETCONF.
> As one very simple example, suppose we have these in the data model:
>
>   leaf ifAdminStatus {
>      config true;
>      type ...;
>   }
>   leaf ifOperStatus {
>      config false;
>      type ...;
>   }
>
> In a <get-config> only ifAdminStatus can occur.  In a <get> both can
> occur.  In an <edit-config>, there can be an nc:operation attribute on
> the ifAdminStatus, but that attribute cannot be present in a <get>.


You can express this very easily like this:

<define name="get-config" combine="interleave">
  <ref name="ifAdminStatus"/>
</define>

<define name="get" combine="interleave">
  <ref name="ifAdminStatus"/>
</define>

<define name="get" combine="interleave">
  <ref name="ifOperStatus"/>
</define>

or in short form:

get-config &= ifAdminStatus
get &= ifAdminStatus
get &= ifOperStatus


thanks,
-rohan