[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook] Marks assignment for qandaentries
Hi Cameron,
There isn't a feature in DocBook to assign marks or
points to a question, because DocBook wasn't really designed for courseware. But
DocBook was designed to be customized and extended, in case you have specialized
needs.
For example, almost all elements include an
empty "local" parameter entity in the DTD for adding new attributes.
In your case, an attribute named "points" could be added to either the question
element or the qandaentry element, which contains the question element.
For example:
<!DOCTYPE book SYSTEM "docbook.dtd"
[
<!ENTITY % local.question.attrib "points CDATA
#IMPLIED">
]>
When the parser loads the DTD, it reads this
internal subset first, and uses this value of the parameter entity instead of
the empty one in the DTD. With this change, you
can add a points attribute to your question elements, and it will
validate.
Putting the entity declaration in the internal
subset of the DTD (in the XML file itself) is fine for a few documents, but if
you have lots, you might consider customizing the external DTD. See Norm
Walsh's book DocBook: The Definitive Guide (online version) chapter 5 for more
info on how to do that:
The DocBook XSL stylesheets won't know about the
new attribute, though, so if you want the points to show in the output, you
would need to customize the XSL template for question.
|
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]