[thelist] Marking up chapter.verse (or chapter.section)

Norman Beresford n.beresford at anansi.co.uk
Mon Dec 15 05:39:16 CST 2003


Hi Tim

I'd take a look at how you're breaking down the data.  At the moment
you're seeing each verse/chapter/book as an independent data type.
Instead you should see them as more ambiguous data types.  A book is a
book, and you'll have multiple books in the text.  So you'll have a book
called Matthew, but also a book called Luke.  Similarly Chapters are the
same, except they have different numbers.  Why make life difficult for
yourself having <chapter1 /> and <chapter2 /> when you could have
<chapter number="1" /> and <chapter number="2" />.  For example

<christianbible>
<newtestament>
<matthew>
<chapter1>
<verse>
<23>
<q>Look, the virgin shall conceive and bear a son, and they shall name
him Emmanuel,</q> which means, <q>God is with us.</q> </23> </verse>
</chapter1> </matthew> </newtestament> </christianbible>

Becomes:


<name>Christian Bible</name>
<sections>
<section name="New Testament">
<book name="Matthew">
<chapter number="1">
<verse number="23">
<quote>Look, the virgin shall conceive and bear a son, and they shall
name him Emmanuel,</quote> which means, <quote>God is with us.</quote> 
</verse>
</chapter>
<chapter number="2">
....
</chapter>
</book>
</section>
<section name="Old Testament">
</section>
</sections>

Now when you create your stylesheet to transform the XML to XHTML you
only have to deal with <book />, <chapter />, <verse /> rather then
<matthew />, <luke /> and <john />. You'll also have a far easier time
selecting ranges from within the data.

HTH

Norman




More information about the thelist mailing list