Thanks Steve,

I tried it but it so far did not work out.

I was not sure what the way forward would be so
I started with my current template, added for example
the style 'para' based on Normal.
I did add a few more like 'sect1-title' basing it on Heading 1.

Saved it as xml in Word.

Then I ran
xsltproc -o word.xml --stringparam wordml.template my_template_en.xml $(DB)/dbk2wordml.xsl docbook.xml

It did not work out, I suspect the template got ignored, it was not included in the word.xml ?

The template I created, and saved as xml starts :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?mso-application progid="Word.Document"?>
<pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage";>

And contains more or less the docx zipped structure in a flat XML file.

(document.xml is based on xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"; if I read things correctly)

or what would be the best way forward ?
Is the 2006 schema supported ?
or do I enter a rabbit hole of trying to keep up to date with Word ?

If the styles.xml and all other are kept can I only update the document.xml? or are the structures intertwined ?

The structure of the docx file contains 13 files, so the template is rather elaborate already. That would then be unzip template, xsltproc -o document.xml without template ? docbook.xml, then zip the file again.

If you have any further pointers that would be helpful. Thanks.

Fredrik Unger


On 04/05/2016 11:35 PM, Steve Ball wrote:
Hi Frederik,

The DocBook stylesheet package includes the roundtripping system that does a 
two-way conversion from DocBook to Word (and Pages and OpenOffice) and back 
again. You use a template document to specify the styles when going from 
DocBook to Word. The system has a template document, but you can supply your 
own.

If you’re just looking for a one-way conversion, then that would be a good 
place to start.

Cheers,
Steve Ball

On 6 Apr 2016, at 5:55 AM, Fredrik Unger <[email protected]> wrote:

Dear all,

I have been trying for a while to generate a Word 2010 file from Docbook.
I have a Word Template with styles for the most common things
like Heading 1, Title etc.

I had some problems with Word 2007 with name changes in styles.
The style Title became Titel in the German version of Word.

I would like to simply put the content of a Docbook article into
a word document using the external template for style.
Actually
pandoc --from=docbook --to=docx --reference-docx=Template.docx 
--output=Article.docx Article.xml
would do but this does not work very well.

What ways or tools are available ?
Do I have to use other formats as intermediate ?
or is it not possible...

Basically the article has sections (nested), title, para, imageobjects, and 
lists.. tables would be a plus.
Would be ok with a subset but a plus if one can map a tag to a style.

Any ideas and pointers ?
I have looked at pandoc and python-docx but the solutions become
complex and not very automatic.
There used to be some effort for stylesheets but I guess that would not work 
with the predefined styles of the Template ?

Fredrik Unger


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to