[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice
Subject:    Re: Converting .kwd files
From:       Nicolas Goutte <nicolasg () snafu ! de>
Date:       2004-06-18 6:01:26
Message-ID: 200406180801.26539.nicolasg () snafu ! de
[Download RAW message or body]

On Thursday 17 June 2004 23:48, Tim Jarman wrote:
> Hello folks,
> I checked Google and the list archives for this to no avail.
>
> I have a deceased Linux box (temporarily, I hope). While it is dead (or
> sleeping) I need to work on some .kwd files on my 'other' machine which
> is running MacOS X.3. Are there any tools I can run on this box which
> can convert .kwd files to RTF, to plain ASCII  or even (shudder) .doc?
> OK I can roll my own if I have to, but life is short.

KOffice documents are zipped, so first you would need an unzip tool.

Then when you have unzipped the document, the important file is maindoc.xml
In KWord, the text is between <TEXT> tags

Attached is a XSL template, if you have xlstproc installed:
xsltproc kwordrecovery.xslt maindoc.xml
and you get a HTML file out of it.

Without xsltproc, I supposr that using grep would be the easiest:
grep "\<TEXT\>" maindoc.xml

>
> Hopefully,
>
> Tim J

Have a nice day!

>
> ____________________________________
> koffice mailing list
> koffice@mail.kde.org
> To unsubscribe please visit:
> https://mail.kde.org/mailman/listinfo/koffice

["kwordrecovery.xslt" (text/x-xslt)]

<?xml version="1.0" encoding="UTF-8"?>
<!-- Emergency text recovery from a KWord's maindoc.xml file -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 <xsl:output method="html" encoding="UTF-8"/>
 <xsl:template match="/">
  <html>
   <head>
    <title>KWord Emergency Text Recovery</title>
   </head>
   <body>
    <xsl:for-each select="/DOC/FRAMESETS/FRAMESET">
     <div>
      <xsl:for-each select="PARAGRAPH">
       <p><xsl:value-of select="TEXT"/></p>
      </xsl:for-each>
     </div>
    </xsl:for-each>
   </body>
  </html>
 </xsl:template>
</xsl:stylesheet> 

____________________________________
koffice mailing list
koffice@mail.kde.org
To unsubscribe please visit:
https://mail.kde.org/mailman/listinfo/koffice


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic