Re: [yang-doctors] Question about yang2dsdl error.

Ladislav Lhotka <lhotka@nic.cz> Fri, 08 November 2019 11:47 UTC

Return-Path: <lhotka@nic.cz>
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 9B7721200B6 for <yang-doctors@ietfa.amsl.com>; Fri, 8 Nov 2019 03:47:04 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.998
X-Spam-Level:
X-Spam-Status: No, score=-6.998 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oVoI_T3Sq8HX for <yang-doctors@ietfa.amsl.com>; Fri, 8 Nov 2019 03:47:02 -0800 (PST)
Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 50B94120041 for <yang-doctors@ietf.org>; Fri, 8 Nov 2019 03:47:02 -0800 (PST)
Received: from birdie (unknown [IPv6:2001:1488:fffe:6:a88f:7eff:fed2:45f8]) by mail.nic.cz (Postfix) with ESMTPSA id 1836C140E96; Fri, 8 Nov 2019 12:47:00 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1573213620; bh=zMZK0y4nP+14Dd+PtQGFtAzxWX4jgCcqWWhYdIdX1GE=; h=From:To:Date; b=KD2qKnspzxzMktBG/a/FtJZP7N6m5+CsQXz2uVSAgKzZcf1j7uYGil6h5lrZPkhUb cHSWHD2UUTSRhSBPHDP6UHmz11YgD+wIMkQ/NHaEqL6sY+ZvKSAqW+3qc41YsTKwuc 3tEuRYQBIGxha0szdpEI33O6uEk36ft3+a98FE+o=
Message-ID: <e2bed3136ade45d6cf71de461a55914f77fb7435.camel@nic.cz>
From: Ladislav Lhotka <lhotka@nic.cz>
To: Christian Hopps <chopps@chopps.org>, YANG Doctors <yang-doctors@ietf.org>
Date: Fri, 08 Nov 2019 12:46:59 +0100
In-Reply-To: <18331DE5-81EE-4A9A-A404-957A24225333@chopps.org>
References: <18331DE5-81EE-4A9A-A404-957A24225333@chopps.org>
Organization: CZ.NIC
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: clamav-milter 0.100.3 at mail.nic.cz
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/sfFVAAn1Uw8X_9Fup-PrsaYTrwk>
Subject: Re: [yang-doctors] Question about yang2dsdl error.
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.29
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: Fri, 08 Nov 2019 11:47:04 -0000

Hi Chris,

On Fri, 2019-11-08 at 06:29 -0500, Christian Hopps wrote:
> Hi yang-doctors,
> 
> I've got an example which yang2dsdl complains about (in it's expected
> unhelpful way :)

The error messages are produced by xmllint, and their unhelpfulness is
notorious.  Apart from that, xmllint RELAX NG validator is known to have other
bugs and gaps.

Have you tried to use Jing [1] for RELAX NG validation (the '-j' option to
yang2dsdl)?

Lada

[1] https://relaxng.org/jclark/jing.html

> In trying to figure out what was wrong, I gave yanglint a try, and it said the
> example was fine (no errors no output with --strict). Can anyone shed some
> light on what might be the issue. I'd really like yang2dsdl to pass here as
> well.
> 
> Example:
> 
> (default) [06:23:07 dak:~/w/reverse-metric-yang]$ cat test-xml-example2.xml
> <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
>   <routing
>       xmlns="urn:ietf:params:xml:ns:yang:ietf-routing">
>     <control-plane-protocols>
>       <control-plane-protocol>
>         <type xmlns:isis="urn:ietf:params:xml:ns:yang:ietf-isis">
>           isis:isis
>         </type>
>         <name>i0</name>
>         <isis xmlns="urn:ietf:params:xml:ns:yang:ietf-isis">
>           <area-address>00</area-address>
>         </isis>
>       </control-plane-protocol>
>     </control-plane-protocols>
>   </routing>
> </config>
> 
> yang2dsdl Error:
> 
> (default) [06:23:05 dak:~/w/reverse-metric-yang]$ yang2dsdl -x -t config -d
> .validate -v test-xml-example2.xml ietf-routing@2016-11-04.yang 
> ietf-isis@2019-10-15.yang
> == Generating RELAX NG schema '.validate/ietf-routing_ietf-isis-config.rng'
> Done.
> 
> == Generating Schematron schema '.validate/ietf-routing_ietf-isis-config.sch'
> Done.
> 
> == Generating DSRL schema '.validate/ietf-routing_ietf-isis-config.dsrl'
> Done.
> 
> == Validating grammar and datatypes ...
> Relax-NG validity error : Extra element control-plane-protocols in interleave
> test-xml-example2.xml:4: element control-plane-protocols: Relax-NG validity
> error : Element routing failed to validate content
> test-xml-example2.xml fails to validate
> 
> Thanks,
> Chris.
> _______________________________________________
> yang-doctors mailing list
> yang-doctors@ietf.org
> https://www.ietf.org/mailman/listinfo/yang-doctors
-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67