lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] XRC RNG validation is incomplete


From: Vadim Zeitlin
Subject: Re: [lmi] XRC RNG validation is incomplete
Date: Fri, 22 Jan 2021 22:18:00 +0100

On Fri, 22 Jan 2021 15:49:59 +0000 Greg Chicares <gchicares@sbcglobal.net> 
wrote:

GC> Vadim--Commit 2d08538d436 demonstrates a defect in an XRC file that
GC> is obvious when running lmi, but wasn't caught by 'xrc.rnc'; should
GC> it have been? I believe the answer is "no", because the offending
GC> line:
GC> 
GC> -                        <growablerows>0,1,2,3,4,5,6,7</growablerows>
GC> +                        <growablerows>0,1,2,3,4,5,6</growablerows>
GC> 
GC> was just as "valid" in the RNG sense without that correction--i.e.,
GC> RNG can test whether "0,1,2,3,4,5,6,7" is _in form_ a comma-separated
GC> list of plausible nonnegative integers, but not whether "7" makes
GC> sense _in context_. But I figured it wouldn't hurt to ask anyway.

 I don't want to categorically state that checking the indices validity
would be impossible in RNG as it has some pretty powerful features that I
am not fully aware about, but I can at least say that I have no idea about
how to do it, especially in this example, where the number of rows is not
even specified in the XML file at all, but is deduced from the number of
child elements in it.

 If we wanted to have an automatic way of finding such problems, I think I
would write a C++ program reading the file and performing the checks in the
code rather than trying to do it using just Relax NG. Such program would be
definitely useful to have, but I'm not sure if it would be useful _enough_
to warrant writing it -- but please let me know if you think it would.

 Thanks,
VZ

Attachment: pgpOCNY1P7Cwk.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]