[netmod] YANG boolean not the same as XSD boolean

Andy Bierman <andy@yumaworks.com> Thu, 16 May 2013 01:15 UTC

Return-Path: <andy@yumaworks.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CA36D11E80E4 for <netmod@ietfa.amsl.com>; Wed, 15 May 2013 18:15:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.742
X-Spam-Level:
X-Spam-Status: No, score=-1.742 tagged_above=-999 required=5 tests=[AWL=0.235, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, NO_RELAYS=-0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AAvkbQwIvsdH for <netmod@ietfa.amsl.com>; Wed, 15 May 2013 18:15:16 -0700 (PDT)
Received: from mail-ia0-x22f.google.com (mail-ia0-x22f.google.com [IPv6:2607:f8b0:4001:c02::22f]) by ietfa.amsl.com (Postfix) with ESMTP id 3A53111E80E3 for <netmod@ietf.org>; Wed, 15 May 2013 18:15:16 -0700 (PDT)
Received: by mail-ia0-f175.google.com with SMTP id m10so2786174iam.6 for <netmod@ietf.org>; Wed, 15 May 2013 18:15:15 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=RZWyyNKog+NFIPb46uuNj+8Ux2Oy/opR55H6GjMM73Q=; b=BqMpclbqebtJfV9hUV0ggaHtWiWTaVW/efNcPV0mbET520vG5D3RZdF1ur5ctvX6xz TnmAr+yVvlM8lQkzC1b7c8+sfaMpKdoQc564O/sphTeZeeEJcr+WmVSikaTlkdR0foIz 5lHcT+YDlXdqJqM7qrFNQ8rQypUqF+KzyPMNptr1FFUhKCIA6T5vyopbgsOc1Y0Vi0bl rHrfxHoa6UqY59oSfTBMh6IYJ1kZ+S4PrthECMY4kDQZLAheinHIQYxADWfhFC4cBcVG Kij9VE0+26oM40bzBJyJTS/fiXWQjy/xP+d2W4J0G0FYvvC0PSTycVO6uVIBrPYzoVct poGw==
MIME-Version: 1.0
X-Received: by 10.50.61.232 with SMTP id t8mr7147850igr.37.1368666914213; Wed, 15 May 2013 18:15:14 -0700 (PDT)
Received: by 10.231.120.74 with HTTP; Wed, 15 May 2013 18:15:14 -0700 (PDT)
Date: Wed, 15 May 2013 18:15:14 -0700
Message-ID: <CABCOCHRmWfqxY1g2PwjFkKFX18B9Dv_oPtUij2GGofjLkz9tWw@mail.gmail.com>
From: Andy Bierman <andy@yumaworks.com>
To: netmod@ietf.org
Content-Type: multipart/alternative; boundary="047d7bdc05e83ce4ad04dccb995a"
X-Gm-Message-State: ALoCoQmfPu1CfPXVotr6091ZyynkHrrR/GAfeIr809vNylsbK4W0YmyaacoPYeSkPTaJjdpN30Qx
Subject: [netmod] YANG boolean not the same as XSD boolean
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/netmod>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 16 May 2013 01:15:17 -0000

Hi,

I just noticed that YANG boolean does not allow "0" or "1" like XSD.
Is this intentional?


9.5.1.  Lexical Representation

   The lexical representation of a boolean value is a string with a
   value of "true" or "false".  These values MUST be in lowercase.


>From http://www.w3.org/TR/xmlschema-2/#boolean:

3.2.2 boolean

[Definition:]  boolean has the ·value space· required to support the
mathematical concept of binary-valued logic: {true, false}.

3.2.2.1 Lexical representation

An instance of a datatype that is defined as ·boolean· can have the
following legal literals {true, false, 1, 0}.

3.2.2.2 Canonical representation

The canonical representation for boolean is the set of literals {true,
false}.


Andy