Is a deterministic schema possible for my index model?
David Sewell <[email protected]> Thu, 16 Dec 2004 14:29:07 -0500 (EST)
| Newsgroups | gmane.text.xml.relaxng.general |
|---|---|
| Message-ID | <[email protected]> |
(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: [email protected] Tel: +1 434 924 9973 Web: http://www.ei.virginia.edu/