OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-publishers message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Drama/poetry mark-up

Hi Norm (and list)

Scott mentioned last night on the Publishers call that you had tried to mark up a play and had problems with stage directions. That's one of the issues that we found when I was writing the DocBook extensions for Penguin. We overcame it by adding two new elements - <direction> and <inlinedirection>. As we are now looking at the next version of DocBook Publishers I thought it might be beneficial to look at those Penguin elements and see if they (or something similar) might be beneficial to DocBook Publishers. The RelaxNG schema component below is the one that we used for Penguin titles. I've deleted some mark-up used for parts (roles/actors/whatever) because it didn't work out well but otherwise it's the same. Obviously, this supports more complex mark-up than DocBook Publishers but I wondered if some of the grammar here might not be of use in DocBook Publishers. 

I have found that the grammar available in DocBook Publishers is too limited to mark up anything but the simplest poetry whilst also managing to have a content model that is *far* too open (db.all.blocks is almost definitely not suitable for the content model of either drama or poetry). The grammar we used for Penguin has been battle tested on several thousand poems and has worked well for all but the oddest. I've hesitated in suggesting any useful changes to DocBook Publishers with respect to poetry because anything that works is going to be completely non backwards compatible. I've included the grammar for those below because poetry and drama share so much markup but we could easily extract just the minor (stage directions) mark-up and use something similar



# Line number attribute. We allow this on lines but we also add it
# as an optional attribute on the docbook
pbl.linenumber.attribute = attribute pbl:linenumber {xsd:integer}?

# Role attribute for pbl content.
pbl.role.attribute = attribute pbl:role {text}

# A single line of text.
pbl.line.attlist = db.common.attributes & pbl.role.attribute?
pbl.line.content = (db.all.inlines | pbl.inlinedirection )+
pbl.line = element pbl:line {pbl.line.attlist, pbl.line.content}

# A group of lines in a poem
pbl.stanza.attlist = db.common.attributes & db.label.attribute? & pbl.role.attribute?
pbl.stanza.content = (db.title?, (pbl.line+ | pbl.linegroup+))
pbl.stanza = element pbl:stanza { pbl.stanza.attlist, pbl.stanza.content }

# A large grouping within a poem. A canto usually consists of a number
# of stanzas so we are currently allowing a canto to consist of a title and two
# or more stanzas.
pbl.canto.attlist = db.common.attributes & db.label.attribute? & pbl.role.attribute?
pbl.canto.content = (db.title?, pbl.stanza, pbl.stanza+)
pbl.canto = element pbl:canto { pbl.canto.attlist, pbl.canto.content }

# A group of lines.
pbl.linegroup.attlist = db.common.attributes & db.label.attribute? & pbl.role.attribute?
pbl.linegroup.content = (pbl.line+)
pbl.linegroup = element pbl:linegroup {pbl.linegroup.attlist, pbl.linegroup.content}

# A poem. A poem is similar to a section although we place it into the
# hierarchy wth paragraphs.
pbl.poem.attlist = db.common.attributes & pbl.role.attribute?
pbl.poem.content = (db.info?, db.para*, (pbl.canto |pbl.stanza)+)
pbl.poem = element pbl:poem {pbl.poem.attlist, pbl.poem.content}

# A stage direction.
pbl.direction.attlist = db.common.attributes & pbl.role.attribute?
pbl.direction.content = (db.para+)
pbl.direction = element pbl:direction {pbl.direction.attlist, pbl.direction.content }

#  inline stage direction.
pbl.inlinedirection.attlist = db.common.attributes & pbl.role.attribute?
pbl.inlinedirection.content = (db.all.inlines+)
pbl.inlinedirection = element pbl:inlinedirection {pbl.inlinedirection.attlist, pbl.inlinedirection.content }

# A speech in a drama.
pbl.speech.attlist = db.common.attributes & pbl.role.attribute?
pbl.speech.content = (
    ((pbl.direction | pbl.line)+ |
    (pbl.direction?, (db.para | pbl.poem | pbl.linegroup | pbl.direction)+)))
pbl.speech = element pbl:speech {pbl.speech.attlist, pbl.speech.content}
# A group of speeches in a drama. The aim of this element is to allow a single direction to apply
# elements that logically group together. We require that at least two speeches are contained in it.
# Direct cause of this was two speeches in Pygmalion that are spoken simultaneously
pbl.speechgroup.attlist = db.common.attributes & pbl.role.attribute?
pbl.speechgroup.content = (pbl.direction?, pbl.speech, pbl.speech+)
pbl.speechgroup = element pbl:speechgroup { pbl.speechgroup.attlist, pbl.speechgroup.content }
# A dialog in a drama.
pbl.dialog.attlist = db.common.attributes & pbl.role.attribute?
pbl.dialog.content = (pbl.direction?, (pbl.speech | pbl.speechgroup), (pbl.speech | pbl.speechgroup | pbl.direction)*)
pbl.dialog = element pbl:dialog {pbl.dialog.attlist, pbl.dialog.content}

db.para.blocks |= pbl.linegroup | pbl.poem | pbl.dialog
db.common.attributes &= pbl.linenumber.attribute
db.common.idreq.attributes &= pbl.linenumber.attribute

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]