Current State : WIP
Contents
DOM to DocBook Conversion
Equivalences
Check DOM DocBook and HTML 2010/DOM-DocBook Equivalences
About this converter
We output DocBook v.5 because it is the last one, and support namespace correctly. So it will allow us to add more features (like a support for MathMl for instance).
We test the output or our converter against the Relax-NG grammar from DocBook http://www.docbook.org/xml/5.0/rng/docbook.rng (we do this only in the unit test naturally).
We handle low lever conversion at this time (so just the DOM Tree, no any conversion using the context, or the metadata).
Status
Current State : WIP (Early stage)
Page Structure
Moin_Page element
DocBook equivalence
Test
Conversion
Comments
<page>
<article>
Done
Done
A page should have an <info> element.
<body>
No equivalence
Done
Done
Basic text Structure
Moin_Page element
DocBook equivalence
Test
Conversion
Comments
<h>
<sectX> + <title>
WIP
WIP
See DOM DocBook and HTML 2010/DocBook-DOM/HeadingConversion Miss more complicate tests.
<p>
<simpara>
Done
Done
<p title="T">
<para><title>
Done
Done
<admonition type="ATR">
<ATR>
Done
Done
Lists
Moin_Page element
DocBook equivalence
Test
Conversion
Comments
<list item-label-generate='unordered'>
<itemizedlist>
Done
Done
<list item-label-generate='ordered'>
<orderedlist>
Done
Done
Convert also list-style-type
<list>
<variablelist>
Done
Done
list-item will be different
<list-item>
<varlistentry>
Done
Done
Only for variablelist
<list-item-label>
<term>
Done
Done
Only within variablelist
<list-item-body>
<listitem>
Done
Done
NB : Text for <listitem> should be within a tag (like para or another list or whatever ...) but not alone.
Tables
DocBook support HTML tables natively. So we can use similar equivalences and source code from HTML_OUT converter.
Moin_Page element
DocBook equivalence
Test
Conversion
Comments
<table>
<table>
Done
Done
A table should have a <caption> or we can use <informaltable>
<table-header>
<thead>
Done
Done
<table-footer>
<tfoot>
Done
Done
<table-body>
<tbody>
Done
Done
<table-row>
<tr>
Done
Done
<table-cell>
<td>
Done
Done
rowspan and colspan attributes.
Paragraph Elements
Moin_Page element
DocBook equivalence
Test
Conversion
Comments
<line-break />
<sbr />
Done
Done
<note note-class="footnote">
<footnote>
Done
Done
<a xlink:href="uri:test">
<link xlink:href="uri:test">
Done
Done
All the xlink attribute should actually be converted, without any checking.
<blockcode>
<screen>
Done
Done
Need to check if we need CDATA.
<span>
<phrase>
Done
Done
<span baseline-shift>
<superscript> or <subscript>
Done
Done
<strong>
<emphasis role="strong">
Done
Done
<emphasis>
<emphasis>
Done
Done
<code>
<literal>
Done
Done
<quote>
<quote>
Done
Done
<blockquote>
<blockquote>
Done
Done
Need an attribution tag
Span element
Here is the list of direct conversion :
- abbrev
- accel
- acronym
- affiliation
- city
- command
- constant
- country
- database
- date
- fax
- filename
- firstname
- foreignphrase
- hardware
- holder
- honorific
And here a dictionary for other possibilities:
- abbr
- abbrev
Objects
Objects in Docbook are wrapped in <inlinemediaobject> or <mediaobject> depending if we use inline of floating display. Since the DOM Tree does not support yet floating image, we are going to use <inlinemediaobject> at first.
After, the object data is itself wrapped in specific tag depending of its kind : <audioobject>, <imageobject>, <textobject>, <videoobject>. We should have an helper function to determine correct the kind of each object. (Already one is working for image).
Then, each object has his specific tag to handle the data. See the example below for more information :
The code : <object xlink:href="myPics.png" type="image/" /> will be converted in :
<inlinemediaobject> <imageobject> <imagedata fileref='myPics.png' /> </imageobject> </inlinemediaobject>
Moin_Page element
DocBook equivalence
Test
Conversion
Comments
<object type="image/" />
<imagedata />
Done
Done
<object type="video/" />
<videodata />
Done
Done
<object type="audio/" />
<audiodata />
Done
Done
Unsupported tag
Here is the list of the unsupported tags. We just emit a log message when we encounter one of these.
<separator>
<span text-decoration>
<span font-size>
ToDo
- See how we can emit the doctype
Test some outputs with different DocBook processors.