[relaxng-user] Is a deterministic schema possible for my index
model?
David Sewell
dsewell at virginia.edu
Thu Dec 16 14:29:07 ICT 2004
(First post from me)
I'm developing a RelaxNG schema to mark up back-of-the-book indexes.
Leaving out refinements like "see also" references and nested
subentries, an index consists of multiple entries. Each entry has a
heading, and one or more page references. I want to use distinct XML
elements for front-matter (roman) pages and body (arabic) pages.
The relevant part of the schema (compact syntax) is this definition:
pages = (pgrom+, pg*) | (pgrom*, pg+)
I.e., there has to be at least one front-matter page or one body page.
Trang turns this into the following DTD fragment:
<!ENTITY % pages "(pgrom+,pg*)|(pgrom*,pg+)">
while the XML schema equivalent is a group containing a choice between
two <xs:sequence> elements. In either case if I attempt to validate a
document instance I get a complaint about a non-deterministic content
model.
Is this just one of those places where Relax NG does something that you
can't do with a DTD or W3C schema? If I want a translatable index
schema, will I have to write
pages = pgrom*, pg*
and therefore permit empty content for "pages"?
David S.
--
David Sewell, Editorial and Technical Manager
Electronic Imprint, The University of Virginia Press
PO Box 400318, Charlottesville, VA 22904-4318 USA
Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903
Email: dsewell at virginia.edu Tel: +1 434 924 9973
Web: http://www.ei.virginia.edu/
More information about the relaxng-user
mailing list