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. Until the next release, you must either extract the files from the CVS repository or use a snapshot build. 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 to DocBook. The XSL stylesheet Example usage: xsltproc -o my-word.xml --stringparam wordml.template template.xml docbook.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 normalised.xml wordml-normalise.xsl my-word.xml xsltproc -o sections.xml wordml-sections.xsl normalised.xml xsltproc -o blocks.xml wordml-blocks.xsl sections.xml xsltproc -o my-docbook.xml wordml-final.xsl blocks.xml The XSL stylesheet Example usage: xsltproc -o index.xml --stringparam pages.template template-pages.xml docbook-pages.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 normalised.xml pages-normalise.xsl index.xml xsltproc -o sections.xml wordml-sections.xsl normalised.xml xsltproc -o blocks.xml wordml-blocks.xsl sections.xml xsltproc -o my-docbook.xml wordml-final.xsl blocks.xml 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. |
Copyright © 2005 explain All rights reserved. Legal notices. Comments or questions about this website? Contact the webperson.