OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Docbook to docx


Hi Steve,

I have a similar question to this. I just tried this conversion from Word to DocBook with a document that uses a lot of special styles. I followed the description found Googling overriding the normalize-common.xsl to map the styles:



  <xsl:import href="rnd-normalise-common.xsl"/>
 
 
<xsl:template name='rnd:map-paragraph-style'>
   
<xsl:param name='style'/>
   
<xsl:choose>
     
<xsl:when test='starts-with($style, "Normal")'/>

     
<!-- Probably should fold all style names to lower-case -->
     
<xsl:when test='$style = "Caption"'>caption</xsl:when>     
     
<xsl:when test='$style = "BodyText"'>Normal</xsl:when>     
     
<xsl:when test='$style = "C1HBullet"'>itemizedlist1</xsl:when>
     
     
<xsl:otherwise>
       
<xsl:value-of select='$style'/>
     
</xsl:otherwise>
   
</xsl:choose>
 
</xsl:template>
 
<xsl:template name='rnd:map-character-style'>
   
<xsl:param name='style'/>
   
<xsl:value-of select='$style'/>
 
</xsl:template>


But I'm still getting error messages, even though the mapping seems to be working to map it to the styles recommended (according to the file specifications.xml):

ERROR "unknown-style": unknown paragraph style "Normal" encountered

ERROR "unknown-style": unknown paragraph style "Normal" encountered

ERROR "unknown-style": unknown paragraph style "Normal" encountered

ERROR "unknown-style": unknown paragraph style "itemizedlist1" encountered

ERROR "unknown-style": unknown paragraph style "itemizedlist1" encountered

ERROR "unknown-style": unknown paragraph style "itemizedlist1" encountered

ERROR "unknown-style": unknown paragraph style "itemizedlist1" encountered


When I look at the result "docbook" file, regular text (paragraphs) still seems to go through, but only if they happened to have the "Normal" style initially in the Word document itself.

However, it doesn't look like docbook tags, but rather some sort of variant with a dbk: prefix - dbk:para etc. I guess that might not be a big deal to fix if I can just get it to recognize the styles, just wondering if this is an error as well or if it's supposed to use that namespace.

What am I doing wrong?



Kind regards,
 
Anders Svensson

CEO, Paligo
 
Anders Svensson | Paligo AB | anders.svensson@paligo.se 
Sankt Eriksgatan 117 | 113 43 Stockholm | Phone: +46 70 815 99 02 



On 5 April 2016 at 23:35:54, Steve Ball (steve.ball@explain.com.au) 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 <fred@tree.se> 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: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]