Re: [Netconf] 4741bis-04 has non-deterministic schema

Martin Bjorklund <mbj@tail-f.com> Fri, 03 December 2010 11:29 UTC

Return-Path: <mbj@tail-f.com>
X-Original-To: netconf@core3.amsl.com
Delivered-To: netconf@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id EDF6128C0FC for <netconf@core3.amsl.com>; Fri, 3 Dec 2010 03:29:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.046
X-Spam-Level:
X-Spam-Status: No, score=-2.046 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HELO_MISMATCH_COM=0.553]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eIXZYdZIJjKc for <netconf@core3.amsl.com>; Fri, 3 Dec 2010 03:29:57 -0800 (PST)
Received: from mail.tail-f.com (de-0316.d.ipeer.se [213.180.79.212]) by core3.amsl.com (Postfix) with ESMTP id D92CE28C18C for <netconf@ietf.org>; Fri, 3 Dec 2010 03:29:56 -0800 (PST)
Received: from localhost (138.162.241.83.in-addr.dgcsystems.net [83.241.162.138]) by mail.tail-f.com (Postfix) with ESMTPSA id 0F0E6616001; Fri, 3 Dec 2010 12:31:13 +0100 (CET)
Date: Fri, 03 Dec 2010 12:31:11 +0100
Message-Id: <20101203.123111.32109474.mbj@tail-f.com>
To: kwatsen@juniper.net
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <84600D05C20FF943918238042D7670FD374419AF64@EMBX01-HQ.jnpr.net>
References: <84600D05C20FF943918238042D7670FD374419AF64@EMBX01-HQ.jnpr.net>
X-Mailer: Mew version 7.0.50 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Cc: netconf@ietf.org
Subject: Re: [Netconf] 4741bis-04 has non-deterministic schema
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Network Configuration WG mailing list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/netconf>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 03 Dec 2010 11:29:58 -0000

Hi,

Kent Watsen <kwatsen@juniper.net> wrote:
> I loaded the schema from 4741bis-04 into XMLSpy (2006) and got the
> following error:
> 
> '<xs:element ref="rpc-error">' makes the content model
> non-deterministic against '<xs:any namespace-"##any">'.

Ugh.  I've validated the XSD with libxml, but it doesn't complain :(
I agree this is an error though.

One option is to change the ##any to ##other:

  <xs:group name="rpcResponse">
    <xs:sequence>
      <xs:element ref="rpc-error"
                  minOccurs="0" maxOccurs="unbounded"/>
      <xs:any namespace="##other" processContents="lax"
              minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:group>

But then we have the problem that the "data" element is not listed
here, since it is defined in the Operations Layer as rpc output to get
and get-config.  This becomes a problem since the XSD and YANG model
both provide elements to the same namespace.

We could handle this by putting data back:

  <xs:group name="rpcResponse">
    <xs:sequence>
      <xs:element ref="rpc-error"
                  minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="data" type="dataInlineType" minOccurs="0"/>
      <xs:any namespace="##other" processContents="lax"
              minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:group>

  <xs:complexType name="dataInlineType">
    <xs:complexContent>
      <xs:extension base="xs:anyType"/>
    </xs:complexContent>
  </xs:complexType>

But then we're mixing layers... 


An alternative would be to use the substitution technique that we
already use for the rpc operation:

  <xs:group name="rpcResponse">
    <xs:sequence>
      <xs:element ref="rpc-error"
                  minOccurs="0" maxOccurs="unbounded"/>
      <xs:element ref="rpcResponse" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:group>

  <xs:complexType name="rpcResponseType"/>
  <xs:element name="rpcResponse"
              type="rpcResponseType" abstract="true"/>


And then if you want to define your own rpc-reply element, e.g. "data"
you would do:

  <xs:element name="data" substitutionGroup="nc:rpcResponse">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="nc:rpcResponseType">
          <xs:sequence>
            <xs:any minOccurs="0" maxOccurs="unbounded"
                    namespace="##other" processContents="lax"/>
          </xs:sequence>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>



/martin