maxwell wrote: > I have a question about where indexterms can show up, and in particular > where they can show up in footnotes. > > According to the DocBook 5 spec, indexterms can appear in footnotes (See > http://www.docbook.org/tdg5/en/html/indexterm.singular.html "indexterm > (db.indexterm.singular)"; I'm not worried about the startofrange/endofrange > kind of indexterm.) The indexterm spec says that footnote is one of the > possible parents of indexterm, and the footnote page confirms that > indexterm can be a child of footnote. > > However, the spec also says (over in the page about footnotes, > http://www.docbook.org/tdg5/en/html/footnote.html, under "Additional > constraints") that "indexterm must not occur in the descendants of > footnote." Which I would understand to mean that the structure > <footnote> > <para> > ...<indexterm.../> > </para> > </footnote> > is forbidden. But that raises the question of where in footnotes > indexterms *can* appear; between the footnote and the para inside the > footnote? > > By itself, this would just be a DocBook question, and therefore > inappropriate to this mailing list. However, it occurred to me that maybe > I could find the answer by creating a DocBook 5 document in XMLmind, and > insert some indexterms. Now XMLmind (we're still using 4.1.0) allows me to > insert indexterms before or after a para inside a footnote (or for that > matter inside the para), but when I tell XXE to "Check Validity", it tells > me that these are all illegal. The specific error msg appearing in the > "Check Validity" pain on the right is "indexterm must not occur in the > descendants of footnote". The error msg appears in a shade of red; maybe > this indicates that the error is being raised by a Schematron rule? (I'm > attaching the document.)
That's right. In order to keep the RELAX NG grammar reasonably simple, the DocBook 5 designers have chosen not to forbid indexterm elements as descendants of footnote elements. However in their mind, this should be really forbidden, that's why they specified this in the Schematron. Editing in XXE is directed by the RELAX NG grammar, not by the Schematron. That's why XXE allows you to insert an indexterm element anywhere inside a footnote (i.e. before, after or *inside* a para). But when you save the document (or explicitly invoke "Tools|Check Validity"), the Schematron warns you that this is illegal. > > So the result is that XXE is telling me that indexterms are not allowed > *anywhere* inside footnotes (or at least not as immediate daughters of the > footnote node and sisters to any paragraphs inside the footnotes). Is this > correct? Yes, indexterms are not allowed *anywhere* inside footnotes. I think that the idea behind this restriction is: with an indexterm found inside a footnote, there is no way to obtain a reliable page reference when generating the index. > How do I put indexterms in footnotes without getting this error > msg? You may want to comment out this element in XXE_install_dir/addon/config/docbook5/docbook5.xxe: --- <schematron location="rng/V5.0/docbook.sch" /> --- OR You may want to comment out the following element in XXE_install_dir/addon/config/docbook5/rng/V5.0/docbook.sch: --- <s:assert test="not(.//db:indexterm)">indexterm must not occur in the descendants of footnote</s:assert> --- However, we do not recommend doing this, because you may have problems when converting your document to other formats (and also, strictly speaking your document is no longer DocBook 5).

