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 wordml problems


Hi Antti,

Firstly, the stylesheet you are using is the old version; I'm  
currently working on a new system of XSL stylesheets, currently only  
in the Subversion repository.  This new version aims to make the  
roundtripping system more maintainable and more easily able to support  
multiple word processors (Open Office, Pages).  At this stage I'm  
reluctant to make fixes to the old stylesheets.

Secondly, the output of the stylesheet is an XML file, not a binary  
Word document.  Therefore the file extension should be ".xml", not  
".doc".

As far as the XML declaration is concerned, that depends on how the  
XSLT engine serialises the result document.  I normally use xsltproc  
(libxslt) and it does the right thing.  The new stylesheet explicitly  
set the character encoding, so it should be OK.  You'll also find that  
Word/Windows requires a processing instruction giving the application  
for the XML document.

MS Word is very helpful with its error reporting, isn't it?  What I do  
is "pretty-print" the WordML document and then try and open it is Word  
again.  That gives you a more helpful line location to track down the  
problem.

Finally, regarding the WordML XML schema, if the document doesn't open  
in Word then that likely is because it doesn't validate.  Validation  
is the first step in getting a document to open in Word, but it is not  
the last step ;-)

HTHs,
Steve Ball

On 04/01/2008, at 1:08 AM, Antti Karanta wrote:

>
>
>                                   Hi!
>
>  I tested the docbook -> wordml xsl stylesheets in the docbook  
> stylesheets distribution and they produced wordml that does not  
> validate against the wordml schema.
>
>  I transformed the docbook document telling what docbook elements  
> are supported in the wordml transformation to wordml.
>  Here's details of what I did:
>
> C:\downloaded\docbook>C:\programs\Java\jdk1.6.0_03\bin\java -Xss1m - 
> cp C:\programs\Java\saxon655\saxon.jar;C:\work\napa\jnapa\commons\lib 
> \batik\xercesImpl.jar;C:\downloaded\docbook\docbook- 
> xsl-1.73.2\extensions\saxon65.jar - 
> Djavax 
> .xml 
> .parsers 
> .DocumentBuilderFactory 
> =org.apache.xerces.jaxp.DocumentBuilderFactoryImpl - 
> Djavax 
> .xml 
> .parsers 
> .SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl  
> com.icl.saxon.StyleSheet -o \temp\supported.doc docbook- 
> xsl-1.73.2\roundtrip\supported_test.xml  \downloaded\docbook\docbook- 
> xsl-1.73.2\roundtrip\docbook.xsl wordml.template=file:///c:/downloaded/docbook/docbook-xsl-1.73.2/roundtrip/template.xml
> Recoverable error
> Ambiguous rule match for /article[1]/articleinfo[1]/author[1]
> Matches both "author|editor|othercredit" on line 267 of file:/C:/ 
> downloaded/docbook/docbook-xsl-1.73.2/roundtrip/docbook
> .xsl
> and "*[contains(name(), "info")]/*[not(self::title|self::subtitle| 
> self::titleabbrev)]" on line 265 of file:/C:/downloade
> d/docbook/docbook-xsl-1.73.2/roundtrip/docbook.xsl
> Recoverable error
> Ambiguous rule match for /article[1]/articleinfo[1]/releaseinfo[1]
> Matches both "releaseinfo" on line 391 of file:/C:/downloaded/ 
> docbook/docbook-xsl-1.73.2/roundtrip/docbook.xsl
> and "*[contains(name(), "info")]/*[not(self::title|self::subtitle| 
> self::titleabbrev)]" on line 265 of file:/C:/downloade
> d/docbook/docbook-xsl-1.73.2/roundtrip/docbook.xsl
> revhistory encountered in articleinfo, but no template matches.
> sgmltag encountered in para, but no template matches.
> literal encountered in para, but no template matches.
> < ... pageloads of these same warnings (?) cut off ...>
>
>  Word opens the generated wordml file as text. This was easily  
> remedied by inserting the missing
> <?xml version="1.0" encoding="UTF-8"?>
>  in the beginning of the file.
>  BTW, why is this missing? Can I set some option to get this snippet  
> generated?
>
>  It does not help a lot, though, now word complains:
> "
> The XML file supported.doc cannot be opened because there are  
> problems with the contents.
> Details:
> Unspecified error
> Error location: Line 3, Column 69343
> "
>
>  Word version 2003 (11.5604.5606)
>
>
>  Also, the generated word document does not validate against the  
> wordml schema (which I downloaded from http://www.microsoft.com/downloads/details.aspx?FamilyID=ca83cb4f-8dee-41a3-9c25-dd889aea781c&displaylang=en 
>  ).
>
>
>  Am I doing something wrong or is this a bug? Any known workarounds?
>
>
>
>        -Antti-
>
>
>
>
>
> ---------------------------------------------------------------------
> 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]