Skip to main content
Known Participant
January 9, 2014
Answered

Docbook DTD chapter element woes

  • January 9, 2014
  • 1 reply
  • 574 views

Hi all,

We have Frame 11 and a doc set based on xDocbook 4.2 -- I know that's way back, but that's not our question.  🙂

We are adding support for a <refentry> element to our docs.  This exists in Docbook and appears in various parent elements, including a <chapter> element.  We need to insert it anywhere in a chapter.

Our Chapter General Rule has been quite simple: Title, Section+

Now we just want the ability to add a RefEntry anywhere that we can add a Section.  I tried this, which seems logical:

Title, (Section | RefEntry)+

With this, we can insert one or more RefEntry elements as the first elements, but if we try to put one after a Section element, we get parsing errors that RefEntry is not allowed in a chapter.  I've tried editing the EDD in numerous ways and have not been able to support a RefEntry to appear anywhere.

I believe -- from what I have read and from looking at the DTD -- that the Docbook DTD should support a RefEntry at any location. I have not tried to customize the chapter element in the DTD regarding the refentry element, although we did add a <textinset> element some years ago, so that the primary content of a chapter in the DTD now looks like this:

<!ENTITY % bookcomponent.content

          "((%divcomponent.mix;)+,

          (sect1*|(%refentry.class;)*|simplesect*|textinset*|section*))

          | (sect1+|(%refentry.class;)+|simplesect+|section+)">


And the chapter element itself is this (default Docbook):

<!ENTITY % chapter.element "INCLUDE">

<![%chapter.element;[

<!ELEMENT chapter (chapterinfo?,

                    (%bookcomponent.title.content;),

                    (%nav.class;)*,

                    tocchap?,

                    (%bookcomponent.content;),

                    (%nav.class;)*)>

One thing that I don't understand is that the refentry element is always in parens, unlike all the others.

In case anyone can help with this, I think I need to paste the error (sorry, this is an eyeful, but it reveals the details of the entire chapter element):

-----------------

Element 'refentry' is not valid for content model '(chapterinfo?,title,subtitle?,titleabbrev?,((toc|lot|index|glossary|bibliography))*,tocchap?,((((textinset|calloutlist|glosslist|itemizedlist|orderedlist|segmentedlist|simplelist|codeannotlist|variablelist|caution|important|note|tip|warning|literallayout|line|programlisting|programlistingco|screen|screenco|screenshot|synopsis|cmdsynopsis|funcsynopsis|classsynopsis|fieldsynopsis|constructorsynopsis|destructorsynopsis|methodsynopsis|formalpara|para|simpara|address|blockquote|graphic|graphicco|mediaobject|mediaobjectco|informalequation|syntax|informalfigure|informaltable|equation|example|figure|table|msgset|procedure|sidebar|qandaset|anchor|bridgehead|remark|editorialnote|highlights|abstract|authorblurb|epigraph|indexterm|beginpage|tocchap|refentry))+,(sect1*|refentry*|simplesect*|textinset*|section*))|sect1+|refentry+|simplesect+|section+),((toc|lot|index|glossary|bibliography))*)'

----------------

Thanks in advance for any help, I appreciate it.

- Shelley

Shelley Hoose

RogueWave Software

This topic has been closed for replies.
Correct answer Lynne A. Price

Shelley,

I had to read your entire message before I was sure that your validation error is in XML rather than FrameMaker. The mismatch is in the definition of %bookcomponent.content. Notice that the +'s in the subexpression:

     (sect1+|(%refentry.class;)+|simplesect+|section+)

are inside the parentheses rather than following it. To paraphrase, this subexpression allows one or more sect1 elements, one or more %referentry.class sequences, one or more simplsect elements, or one or more section elements. It does not allow intermixing of these four possibilities as would the variation created by deleting the internal +'s and putting a single + after the closing parenthesis:

     (sect1|(%refentry.class;)|simplesect|section)+

Note that the latter is parallel to what you have in your EDD.

The reason that %refentry.class; is enclosed in parentheses is that it could be declared to be a subexpression using commas which can't be used at the same level as the existing vertical bars. No parens are needed around the other terms in the expression because they are single elements that do not contain connectors.

    --Lynne

1 reply

Lynne A. PriceCorrect answer
Inspiring
January 9, 2014

Shelley,

I had to read your entire message before I was sure that your validation error is in XML rather than FrameMaker. The mismatch is in the definition of %bookcomponent.content. Notice that the +'s in the subexpression:

     (sect1+|(%refentry.class;)+|simplesect+|section+)

are inside the parentheses rather than following it. To paraphrase, this subexpression allows one or more sect1 elements, one or more %referentry.class sequences, one or more simplsect elements, or one or more section elements. It does not allow intermixing of these four possibilities as would the variation created by deleting the internal +'s and putting a single + after the closing parenthesis:

     (sect1|(%refentry.class;)|simplesect|section)+

Note that the latter is parallel to what you have in your EDD.

The reason that %refentry.class; is enclosed in parentheses is that it could be declared to be a subexpression using commas which can't be used at the same level as the existing vertical bars. No parens are needed around the other terms in the expression because they are single elements that do not contain connectors.

    --Lynne

shooseAuthor
Known Participant
January 9, 2014

Lynne!  Thank you soooo much.  Working now.  And I wasted all day yesterday on this.  :-)