In quite a number of different places, we want to be able to represent general narratives—descriptions of places, birds, weather, and such. In these narrative sections, we want to be able to use special inline tags to markup elements that need special typography. In particular, we want to present scientific names in italics.
Another important structural feature of narrative content is the ability to break it up into paragraphs. For example, in the route description, it is useful to be able to break up the major sections of the routes into separate paragraphs, rather than presenting it as all one huge glob.
We could use something like DocBook's para
element to hold such narrative, and use a content model
something like “para+” to
allow one or more paragraphs.
However, most of the time, narrative content will be
rather short, and it is somewhat burdensome to force the
writer to wrap just a short note inside a para element.
The solution in these locations is to allow either a
sequence of para elements, or just the
content that goes inside a para. In the
latter case, there is an implied para
element wrapping up the content.
Here are the relevant parts of the schema for narrative
content. First, we define the para
element itself:
para = element para
{ para-content
}
para-content = mixed { para-markup* }
para-markup = (genus|cite)
genus = element genus { text }
cite = element cite { text }
para-content
This pattern describes what can go inside a
paragraph. The Relax NG “mixed” construct means that the content may be
any mixture of plain text, or occurrences of either
genus or cite inline
elements.
para-markup
This pattern enumerates the elements that can occur
inside an explicit or implied para
paragraph.
genus
An inline element containing a scientific name of genus rank or lower, to be rendered in italics.
cite
An inline element containing a citation of a book, article, movie, or other reference whose name should be rendered in italics.
Finally, we define the narrative pattern:
either a sequence of paragraphs, or mixed content that
can occur inside a paragraph.
narrative = ( para+ | para-content )