DocBook Roundtripping Explain's Steve Ball, in conjunction with Bob Stayton, has developed a set of XSL stylesheets that convert Microsoft's WordML into DocBook and back again. These stylesheets are intended to allow "roundtripping" of DocBook documents, ie. to convert DocBook documents into Word and back in DocBook with no loss of data and structure. The aim of this is to allow a word processor to be used to edit DocBook XML documents. All of the XSL stylesheets are part of the DocBook XSL project. More than one word processor application is supported. At present there is support for Microsoft Office 2003 and Apple Pages. In order to use MS Word it is necessary to save documents in XML format (ie. using WordML). To use Apple Pages, it is necessary to copy the There are two sets of XSL stylesheets; one set for converting DocBook into Word (WordML) or Pages, and another set for converting WordML or Pages to DocBook. The XSL stylesheet Example usage: xsltproc -o my-word.xml --stringparam wordml.template template.xml dbk2wordml.xsl my-docbook.xml The document template is a WordML document, but its body text is not used. This allows the user to change the formatting properties used by the various styles by simply using Word's menus and dialogs. Transforming a WordML document into DocBook involves "chaining" the XML document through a "pipeline" of XSL stylesheets. There are four XSL stylesheets involved: Example usage: xsltproc -o my-word.norm wordml2normalise.xsl my-word.xml xsltproc -o my-word.sects normalise2sections.xsl my-word.norm xsltproc -o my-word.blks sections2blocks.xsl my-word.sects xsltproc -o my-docbook.xml blocks2dbk.xsl my-word.blks The XSL stylesheet Example usage: xsltproc -o index.xml --stringparam pages.template template-pages.xml dbk2pages.xsl my-docbook.xml The result document, The document template is a Pages index document, but its body text is not used. This allows the user to change the formatting properties used by the various styles by simply using Pages's menus and dialogs. A Pages document is actually a "bundle", ie. although it appears as a single icon it is really a directory that contains all of the files needed for the document. Control-click on the Pages document icon and select "Show Package Contents". Inside the bundle is an index file, either Transforming the Pages index document into DocBook involves "chaining" the XML document through a "pipeline" of XSL stylesheets. There are four XSL stylesheets involved: Example usage: xsltproc -o my-word.norm pages2normalise.xsl index.xml xsltproc -o my-word.sects normalise2sections.xsl my-word.norm xsltproc -o my-word.blks sections2blocks.xsl my-word.sects xsltproc -o my-docbook.xml blocks2dbk.xsl my-word.blks The roundtripping system does not support all of the DocBook elements. See Supported Elements for the current status of support of DocBook elements. Contact Explain for support. Explain offers commercial support, for those organisations that need it. An easy way to handle the chaining of XSL stylesheets is to use Packaged Press Desktop Edition (PPDE). PPDE is an XProc pipeline controller and a pipeline is provided for the DocBook roundtripping system. |
Copyright © 2005-2010 Explain. All rights reserved.Legal notices. Comments or questions about this website? Contact the webperson.