<?xml version="1.0" encoding="UTF-8"?>
<essay xml:lang="en" version="pto" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:gal="http://norman.walsh.name/rdf/gallery#">
<info>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
<title>The DocBook Encoding Initiative or “TextBook”?</title><biblioid class="uri">http://norman.walsh.name/2003/10/09/dei</biblioid>
<volumenum>6</volumenum>
<issuenum>95</issuenum>
<pubdate>2003-10-09</pubdate>
<date>$Date$</date>
<author>
      <personname>
<firstname>Norman</firstname>
	<surname>Walsh</surname>
</personname>
    </author>
<copyright>
      <year>2003</year>
      <holder>Norman Walsh</holder>
    </copyright>
<abstract>
<para>In a lot of ways, DocBook and the TEI are very similar. I spent
most of today looking over the TEI Meta language and the constructs
in DocBook and the TEI. Maybe it’s possible to design our schemas so
that they can easily interoperate. In any event, a few touristy snaps
of Oxford as well.</para>
</abstract>
<dc:coverage rdf:resource="http://norman.walsh.name/knows/where/gb-oxford"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#DocBook"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#England"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#Photography"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#Travel"/>
</info>

<epigraph>
<attribution>Sa'di</attribution>
<para xml:id="p1"><indexterm>
	<primary>Sa'di</primary>
      </indexterm>An
ill-humoured man is a prisoner at the mercy of
an enemy from whom he can never escape.</para>
</epigraph>

<para xml:id="p2">I think there’s always been some good-humored competition between
<link xlink:href="http://docbook.org/">DocBook</link><indexterm>
<primary>DocBook</primary>
    </indexterm> and the
<link xlink:href="http://www.tei-c.org/">TEI</link><indexterm>
<primary>TEI</primary>
<see>Text Encoding Initiative</see>
    </indexterm><indexterm>
<primary>Text Encoding Initiative</primary>
    </indexterm>. Or maybe it’s
just between Sebastian and myself; his invitation to join the
<citetitle>TEI Meta</citetitle> working group came in a message
with the subject “Working with the enemy?” It was an invitation that
I accepted gladly.</para>

<para xml:id="p3">In a lot of ways, DocBook and the TEI are very similar: they are
both large, rich schemas designed for marking up textual documents in
ways that convey semantic information relevant to a human reader. And
while each has particular strengths, to a certain extent, both can stretch to fill
the others shoes: many of the
<link xlink:href="http://www.oucs.ox.ac.uk/">Oxford University
Computing Services</link> web pages are created from a TEI extension and
I’ve seen works on Islamic architecture authored in DocBook.</para>

<para xml:id="p4">The working groups responsible for DocBook
and the TEI are both considering how to migrate to their next major versions
(coincidentally, both of which will be version 5). The groups are also,
less coincidentally I think, both
actively exploring RELAX NG<indexterm>
      <primary>RELAX NG</primary>
    </indexterm>
as the natural schema language in which to express their designs.</para>

<para xml:id="p5">Since I was already on this side of the pond for other business
and a few days vacation, I jumped at the chance to come down to Oxford
for a day and meet face-to-face.</para>

<gal:images>
  <rdf:Seq>
    <rdf:li rdf:resource="images/church1"/>
    <rdf:li rdf:resource="images/church2"/>
  </rdf:Seq>
</gal:images>

<para xml:id="p6">So <link xlink:href="/knows/who#sebastian-rahtz">
      <personname>
<firstname>Sebastian</firstname>
	<surname>Rahtz</surname>
</personname>
    </link>,
<link xlink:href="/knows/who#lou-burnard">
      <personname>
<firstname>Lou</firstname>
	<surname>Burnard</surname>
</personname>
    </link>, and I spent most of today looking over the TEI
Meta language and the markup constructs in DocBook and the TEI.
As we pored over the schemas, we talked about the best way to
express one constraint or another. The TEI is built from a true literate
programming system, so there were some interesting issues to discuss.</para>

<gal:image rdf:resource="images/royaloak"/>

<para xml:id="p7">One topic that we came back to many times was, would it be possible
to design our schemas so that they could easily import modules from each other?
For example, could DocBook be structured so that TEI could easily import
the GUI inlines if someone wanted to write a book about computer software
in TEI? Or could TEI be structured so that DocBook could easily import
markup for dictionary entries if someone wanted to write a dictionary
about computer terms.</para>

<para xml:id="p8">In a DTD world, I think this would have been practically impossible.
But RELAX NG deals a lot more intelligently with extension; constructs
like <emphasis>interleave</emphasis> can be used to extend patterns without
completely redefining them. (In DTDs, parameter entities can be defined
exactly once so you really have to jump through hoops.)</para>

<para xml:id="p9">With a little coordination, I think we’ll be able to define
“link points,” where DocBook and the TEI share common pattern names. I
believe that will make it possible to insert modules across schema
boundaries at those points.
</para>

<section xml:id="s1">
    <title>Who’s Namespace is This?</title>

<para xml:id="p10">For inline elements and elements with very specific content models,
it seems reasonable to use namespaces. So a DocBook <tag>guimenuitem</tag>
might be a <tag>db:guimenuitem</tag> in the TEI (assuming we put
DocBook in a namespace).</para>

<para xml:id="p11">Now consider the following scenario. Suppose it’s possible to configure
DocBook and the TEI so that DocBook can import the TEI module that supports markup
for plays. It’s a stretch, but maybe you’re writing a book that uses dialog
between two programmers to make your points.</para>

<para xml:id="p12">At some point inside the dialog markup, you’re going to get to
“paragraphs” and you’re going to want DocBook
<tag>para</tag>’s, not TEI <tag>p</tag>s. If DocBook and the
TEI coordinate well, customizations like this will work just fine. The
module for plays will interleave itself into the right patterns so that
it can be used in DocBook and it will refer to some pattern for “paragraph
content” that will be appopriately defined in each schema.</para>

<para xml:id="p13">What namespace should the play elements be in? Are they TEI elements
with DocBook content, or are they DocBook elements isomorphic to the TEI elements?
Should DocBook and TEI be in the same namespace?</para>

<para xml:id="p14">(Maybe you disagree and think that after you switch to TEI, it’s TEI
all the way to the leaves. That’s a defensible position, but I don’t
think it’s as interesting or useful.)</para>

</section>
</essay>

