Jirka Kosek wrote: > > it seems that DocBook V5 schema is written in a way which permanently > turns XXE into lenient mode (which is of course not very handy for real > editing).
This is a bit severe. This more or less implies that XXE does not support RELAX NG at all! XXE has limitations which makes it uncomfortable using some RELAX NG schemas but despite these limitations (which are fully described in http://www.xmlmind.com/xmleditor/_distrib/doc/rngsupport/index.html), XXE should allow to comfortably edit the vast majority of the documents conforming a RELAX NG schema. > The cause of this are info and indexterm elements. I can understand why > info cause lenient mode. If you have element with required title such > chapter, you can write it down like > > <chapter> > <title> > > or > > <chapter> > <info> > <title> > > I can see ambiguity here and this is not problem for me, because I > actually use customized version of DocBook which allows only former way > of specifying title. I don't see any big problem here: * The user chooses to insert <title> ==> no lenient mode for <chapter>. * The user chooses to insert <info> (and this kind of <info> can contain a <title>) ==> no lenient mode for <chapter>. * The user chooses to insert <title>+<info>' ==> lenient mode for <chapter>. (I'm using XXE V3.2 and DocBook V5b5.) Therefore suffice for the user not to choose <title>+<info>' (who needs <title>+<info> anyway when the first kind of <info> can contain a <title>?). > What I actually do not get is problem with indexterms. Because indexterm > can be child of almost any element in DocBook it means that lenient mode > is present on almost all DocBook elements. But why lenient mode must be > used for elements that contain indexterm? > > DocBook schema defines three content models for indexterm which are then > combined together to single pattern used in places suitable for > indexterm. Suppose that I'm in <para>. Now I should be able to insert > dozen of DocBook inline elements including indexterm. But because there > are three different kinds of indexterm, whole para element is edited > inside lenient mode and element completition is confused. Couldn't this > be propagated one level down? It should be possible to infer from schema > that indexterm is allowed here and lenient mode should be activated only > inside indexterm. > > Actually I was able to workaround indexterm problems by pattern > refactoring for indexterm, so schema defined as > > include "docbook.rnc" > { > db.indexterm.singular = > db.indexterm.singular.attlist, > db.indexterm.contentmodel > > db.indexterm.startofrange = > db.indexterm.startofrange.attlist, > db.indexterm.contentmodel > > db.indexterm.endofrange = > db.indexterm.endofrange.attlist, > empty > > db.indexterm = > element indexterm { > db.indexterm.singular > | db.indexterm.startofrange > | db.indexterm.endofrange > } > } > > doesn't cause lenient mode on parents of indexterms. But couldn't his > simple case be handled directly by XXE? XXE already detects this case for class=startofrange and class=endofrange, but not for db.indexterm.singular (???). In the latter case, I think this is a bug because "Show Content Model" (Shift-F1) says that there should be no problem with any of the <indexterm>s (all kinds of <indexterm>s are displayed with a yellow background). We'll try to fix this bug ASAP. > I mean if you found element which contains content model like > > ... (element X { patternA } | element X { patternB }) ... > > you could internally rewrite it to > > ... (element X { patternA | patternB }) ... > > This way I suppose that lenient mode will be more rare to occur for many > schemas. The lenient mode is *already* uncommon for most schemas. But thank you to take the time to report these problems because this is the only way to improve the support of RELAX NG Schemas in XXE.

