[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [office] vialotaion of relaxng schema constraints
Hi, I brought this on up on xml-dev and it looks like I wasn't right after all - which I consider to be a quite fortunate thing in this matter :) As sec. 7 of the RelaxNG spec states, restrictions apply after the grammer has been simplified. Section 4.19 defines the simplification applied to ref elements. This seems to be a bug in xmllint's simplification algorithm, and we thus shouldn't change anything. Bests, ~Lars Michael Brauer wrote: > Hi, > > Lars is right. According to §7.1.3 of > > http://www.oasis-open.org/committees/relax-ng/spec.html > > refs within lists are in fact prohibited. This issue could be resolved by > > a) replacing the reference with the content of the reference definition, or > b) by replacing the lists themselves with a string data type. > > While the first solution increases the size of the schema and makes it > harder to read, the 2nd solution makes the schema less strict regarding > validations > > I've checked the occurences of "ref" within "list" in our spec. Where > are two kinds of them: > > 1. References to data types. The data types referenced are: integer, > double, percent, length, positiveLength. > > 2. References to defines containing choices of values. An example is the > definition of "style:position" in "15.4.23 Paragraph Background Color". > > It seems that solution a) doesn't make the schema completely unreadable > in both cases, so I propose to choose that option. > > Michael > > > Lars Oppermann wrote: > >>Hi folks, >> >>I just checked out validation of some documents against the schema with >>libxml2's xmllint. I have never used that before but wanted to check out >>libxml2's relaxng support. >>Well, lots of errors but all of the same type: >> >>office-schema-1.0-draft-19.rng:13704: element ref: Relax-NG parser error >>: Found forbidden pattern list//ref >> >>And it's right, ref isn't allowed in lists; (see section 'list >>constraints' at http://books.xmlschemata.org/relaxng/ch17s02.html) >> >>I'm not quite sure about the implications of this, since I'm not an >>expert at all on relaxng matters. Replacing refs with the original >>definition would fix the error but we'd lose the nice abstraction level >>we've got by using defines for patterns (like e.g. percent) >> >>Any suggestions? >> >>Bests >>~Lars >> > > > -- Lars Oppermann <lars.oppermann@sun.com> Sun Microsystems Software Engineer - StarOffice Sachsenfeld 4 Phone: +49 40 23646 959 D-20097 Hamburg Fax: +49 40 23646 550 http://www.sun.com/staroffice
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]