xmlguru.cz

Spreading the XML paradigm around

Using ITS 2.0 in DocBook

2013-05-15

ITS 2.0 is rushing into final standardization stages. DocBook supported ITS 1.0 from very early stages so I have upgraded DocBook schema with ITS 2.0 support.


Table of Contents

Getting schema
Processing ITS markup inside DocBook

ITS provides set of metadata which can be injected into your document in order to make localization and translation of your content more easier. ITS can be expressed by using several attributes and elements, see following simple example of DocBook content with ITS markup.

<?xml version="1.0" encoding="utf-8"?>
<article xmlns="http://docbook.org/ns/docbook"
         xmlns:db="http://docbook.org/ns/docbook"
         xmlns:its="http://www.w3.org/2005/11/its"
         version="5.0">
  <info>
    <title>Test</title>
    <its:rules version="2.0">
      <its:translateRule selector="//db:programlisting" translate="no"/>
    </its:rules>
  </info>

  <programlisting>print "Hello World!"</programlisting>
  
  <para>See you in <phrase its:term="yes">Berlin</phrase>.</para>

  <para>But there are other cities to go
  if you like <phrase its:translate="no">foie gras</phrase>.</para>
  
</article>

Getting schema

If you want to start using ITS markup in your DocBook documents you need to obtain special DocBook+ITS schema. This schema will became standard part of a next release of DocBook schema and will be available at http://docbook.org/xml/. In a meanwhile you can use the following schemas:

Processing ITS markup inside DocBook

As DocBook content is XML you can use any ITS 2.0 aware tool with it like various CAT tools. Next release of DocBook XSL stylesheets will support local ITS markup and will propagate it into generated HTML code. Before next official release is out, you can download snapshot version of stylesheets from http://snapshots.docbook.org/.

ITS support in stylesheets allows you to very easily achieve very nice things. As ITS markup is propagated into generated HTML code it can be used by various translation widgets. This is really important in these times—companies are trying to save costs and providing only machine translated documents for languages on margin markets is one way to go. ITS markup can greatly improve precision of a machine translation.

Figure 1. ITS roundtrip in action

ITS roundtrip in action

Download sample files:

blog comments powered by Disqus
Copyright © Jiří Kosek, 2006–2018