---------------------------------------------------------------------------------------------------------------------------

DocBook

ญญญญญญญญญ----ญญญญญญญญญญญญญญญญญญญญญญญญญญญญ-----------------------------------------------------------------------------------------------------------------------

Part1 - DocBook

This week I was primarily going through the last Lecture’s materials related to the DocBook. I’ve downloaded and installed free DocBook tool for Windows platform called eDE (http://www.e-novative.info/software/ede.php ). This is command-based tool with which you create professional documents in various formats (HTML, HTML Help, PDF) from a single XML source. I also have downloaded DocBook style sheets and use it via my XML editor program Cooktop to generate html or pdf versions of my xml documents. I tried it first with html_it files from the lectures as shownd below.

Part1.1 – Cooktop tool

XML Source: Lecture04.xml

Initially it failed to validat with the following error:

After I removed <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"

"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"> reference, the validation passed and the output got generated

 

DocBook stypesheet:

HTML Output:

The output does not have the bodies from the referenced includes for some reason.

 

Part1.2 - xsltproc

I found and installed xsltproc tool set on my Windows PC and tested it with the same set of files that did not work in the Cooktop. I created batch file to execute xsltproc command:

set FILEBASE=z:\XML2008\L8\html_it\

set FILENANE=lecture04

set DOKBOOKBASE=z:\XML2008\L8\Dookbook\stylesheets\docbook-xsl-1.73.2\html\

set DOKBOOK=docbook.xsl

 

xsltproc --xinclude -o %FILEBASE%%FILENANE%.html %DOKBOOKBASE%%DOKBOOK% %FILEBASE%%FILENANE%.xml

 

HTML Output:

It turns out that the HTML version of the input xml file with multiple  Xincludes turned out to be correct.

 

Part2 – HTML to XML Conversion

 

To be able to make DocBook type file for the homework, I will have to figure out the way to store my lectures overview and assignments files in a format that DocBook will recognize, which is XML. Since they all in HTML format now, I have to do HTML to XML conversion. Tidy tool is the most popular program that does it and I was experimenting with different tools that use Tidy as the main engine for such conversion. I end up using HTML-Kit Windows program (available at http://www.chami.com/html-kit/ ). The program is very intuitive and powerful. I open one of my weekly notes html files and quickly found that it’s not pure html, but xhtml instead. With some help from the tool I was able to convert it to pure html and then to XML format

Note: Since XHTML is a valid XML formatted document, I might be able to use it instead of XML version to avoid conversions.