[YS: Here is a possible start for the DocBook module. I had to remove the reference to xml:id if docbook.xsd because it was not accepted for unknown reason: I can't get XMPSpy to validate the documents if it's there. Note also that using RELAX NG would probably be better as DocBook's doc indicates that only the RELAX NG schema is the normative one)]
DocBook is a system for writing structured documents using SGML or XML. DocBook has been in use for many years in many different organizations. It is currently maintained by the OASIS DocBook Technical Committee.
Different versions of DocBook exist. This section addresses DocBook V5 using its XML Schema file.
Allowing ITS markup in DocBook documents takes the following steps:
First, add the ITS namespace and import the ITS schema in the DocBook schema
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:docbook="http://docbook.org/ns/docbook" xmlns:its="http://www.w3.org/2005/11/its" targetNamespace="http://docbook.org/ns/docbook" elementFormDefault="qualified"> <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd"/> <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/> <xs:import namespace="http://www.w3.org/2005/11/its" schemaLocation="its.xsd"/> ...
Then, add the reference to the <documentRules>
element
in the DocBook <info>
element.
... <xs:element name="info"> <xs:complexType> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="docbook:title"/> <xs:element ref="docbook:titleabbrev"/> <xs:element ref="docbook:subtitle"/> </xs:choice> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="its:documentRules"/> <xs:element ref="docbook:abstract"/> <xs:element ref="docbook:address"/> ...
And finally, add some of the ITS data categories attributes to the DocBook common attributes group.
... <xs:attributeGroup name="db.common.attributes"> <xs:attribute ref="xml:id"/> <xs:attribute name="version"/> <xs:attribute ref="xml:lang"/> <xs:attributeGroup ref="its:att.datacats.attribute.translate"/> <xs:attributeGroup ref="its:att.datacats.attribute.locInfo"/> <xs:attributeGroup ref="its:att.datacats.attribute.locInfoType"/> <xs:attribute ref="xml:base"/> ...
This will allow to insert ITS markup as needed in DocBook documents like here:
<article xmlns="http://docbook.org/ns/docbook" xmlns:its="http://www.w3.org/2005/11/its" its:translate="yes"> <info> <title>An example article</title> <author its:translate="no"> <personname> <firstname>John</firstname> <surname>Doe</surname> </personname> <affiliation> <address><email>foo@example.com</email></address> </affiliation> </author> </info> <para>This is an example.</para> </article>
A number of DocBook elements can be mapped to ITS data categories.
The following documentRules
provides the mapping between
the ITS data categories and the DocBook markup.
[YS: This is just a start: there are quite a few DocBook elements that contain non-translatable text, and I have not check for Ruby support yet. ]
<its:documentRules xmlns:its="http://www.w3.org/2005/11/its"> <its:ns its:prefix="db" its:uri="http://docbook.org/ns/docbook"/> <!-- Bidi information --> <its:documentRule its:dirSelector="//db:*[@dir='ltr']" its:dir="ltr"/> <its:documentRule its:dirSelector="//db:*[@dir='rtl']" its:dir="rtl"/> <its:documentRule its:dirSelector="//db:*[@dir='lro']" its:dir="lro"/> <its:documentRule its:dirSelector="//db:*[@dir='rlo']" its:dir="rlo"/> <!-- Terms --> <its:documentRule its:termSelector="//db:firstterm" its:term="yes"/> <its:documentRule its:termSelector="//db:term" its:term="yes"/> <its:documentRule its:termSelector="//db:glossterm" its:term="yes"/> <its:documentRule its:termSelector="//db:primary" its:term="yes"/> <its:documentRule its:termSelector="//db:secondary" its:term="yes"/> <its:documentRule its:termSelector="//db:primaryie" its:term="yes"/> <its:documentRule its:termSelector="//db:secondaryie" its:term="yes"/> </its:documentRules>