Lists Home |
Date Index |
- To: email@example.com
- Subject: Relax-NG schema design question
- From: Lars Oppermann <Lars.Oppermann@Sun.COM>
- Date: Tue, 30 Nov 2004 10:49:03 +0100
- Organization: Sun Microsystems Inc.
- User-agent: Mozilla Thunderbird 0.9 (Windows/20041103)
I'm working on the OpenDocument (OpenOffice) format specification. We
are using RelaxNG for our schema and recently semm to have discovered a
flaw in our schema which some validators don't regard as a flaw (e.g.
sun multi schema validator (2003-02-25) and jing (2003-06-19)), but
others do (e.g. xmllint (libxml2-2.6.16)).
We are using attributes, which contain a list of values. The type of
those values is referenced rather then defined every time it is used. E.g.:
<define name="draw-enhanced-geometry-attlist" combine="interleave">
<attribute name="draw:extrusion-depth" a:defaultValue="36pt 0">
Where for example length is defined elsewhere as
Only the fact, that xmllint reported "element ref: Relax-NG parser
error: Found forbidden pattern list//ref" made us aware of the fact,
that relax-ng in fact constraints the use of refs in lists.
I do see the reason for the contraint, but what would be the right way
to define such structures? Repeating the pattern every time the ref was
used would solve the error, but would mess up the design quite a bit,
since there wouldn't be a central place where types like length could be
maintained. So if one decided to at e.g. 'ft' to the pattern, all
occurences would have to be updated.
I'm new to relax-ng and I hope I'm just missing something obvious here.
I'm also not quite sure what I should make of the fact, that some
Lars Oppermann <firstname.lastname@example.org> 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