Reading xml file

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Reading xml file

Postby mikejd » Tue Nov 13, 2012 8:13 pm

I have been sent a document saved in OpenOffice as an ODF file. When I open it it contains xml data and is not readily readable. I have tried to save as .sxw and .doc files but it is still the same. How do I convert this to a legible document?

any help appreciated.
mikejd
LXF regular
 
Posts: 134
Joined: Fri Apr 08, 2005 4:46 pm
Location: Huntly, Aberdeenshire

Postby nelz » Tue Nov 13, 2012 8:52 pm

What does the file command say it is?

Code: Select all
file yourfile.odf
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby guy » Tue Nov 13, 2012 9:09 pm

What app are you trying to open it in?

ODF files are XML based, so opening the raw file in a text editor would show just what you are seeing.

If that's the problem, you need an ODF compatible app such as LibreOffice, OpenOffice or Abiword - see http://en.wikipedia.org/wiki/OpenDocument for a good list.
"Klinger, do you know how many zoots were killed to make that one suit?" — BJ Hunnicutt
User avatar
guy
LXF regular
 
Posts: 1105
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Postby nelz » Tue Nov 13, 2012 10:12 pm

Most ODF formats are a zipped archive containing XML files. The flat formats, like .fodt, are plain XML but these don't seem to be used that often. file will tell you hat the file actually is, rather than what the extension is claiming it to be.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby mikejd » Wed Nov 14, 2012 9:38 am

Thanks for the replies.

The file is a .odt format. I can open the document in LibreOffice but all I read is the xml data, the content is not readily readable. I have tried saving in different formats, eg .doc and .sxw, as suggested by various Google links but no change.
mikejd
LXF regular
 
Posts: 134
Joined: Fri Apr 08, 2005 4:46 pm
Location: Huntly, Aberdeenshire

Postby nelz » Wed Nov 14, 2012 9:52 am

What should the file contain?

What is the output from "file filename.odt"?

Are the contents of the file private or it is it possible to post it somewhere so we can try it?
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby mikejd » Wed Nov 14, 2012 12:57 pm

The file is a report written in OpenOffice. Not my file so I don't know what happened to it. I have been asked if I can help sort it out.

file command outputs 'OpenDocument text'

File is confidential so can't post up.

Since last post I have managed to extract the text content by a roundabout route - select all content, copy and paste into Quanta, select view which displays the text, copy the text and paste into a new doc in LibreOffice, save as .doc file. The text is completely unformatted so will need paragraphs, line breaks, etc added but at least the text is not lost and won't need to be retyped (report is 16 pages long).

So, have solved the problem for now but I still would be interested to know why it can't be opened properly in OpenOffice.

Thanks for all help.

regards,
Mike
mikejd
LXF regular
 
Posts: 134
Joined: Fri Apr 08, 2005 4:46 pm
Location: Huntly, Aberdeenshire

Postby nelz » Wed Nov 14, 2012 1:01 pm

Can the person who sent it to you open it? Are they using the same version of OOo?
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby mikejd » Wed Nov 14, 2012 1:06 pm

They are able to open it but it cannot be read as it is in XML. Following is first 10 lines:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><?mso-application progid="Word.Document"?><w:wordDocument xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xml:space="preserve" w:embeddedObjPresent="no">

Don't know which version they use, I am using LibreOfficev3.5.
mikejd
LXF regular
 
Posts: 134
Joined: Fri Apr 08, 2005 4:46 pm
Location: Huntly, Aberdeenshire

Postby nelz » Wed Nov 14, 2012 1:13 pm

I get the same if a save a document as Microsoft Word 2003 XML from LibreOffice 3.6.3.2, it's not an ODF file. However, LO can also open the file here. My guess is that something screwed up when saving the file.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8577
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby mikejd » Wed Nov 14, 2012 1:21 pm

Thanks, nelz.

At least I now have the full text to save retyping. i guess it will have to remain a question how it got like it. Let's just blame it on Ooo on Windows not saving correctly and thank Linux for being able to retrieve the situation.

cheers.
mikejd
LXF regular
 
Posts: 134
Joined: Fri Apr 08, 2005 4:46 pm
Location: Huntly, Aberdeenshire

Postby Ram » Wed Nov 14, 2012 3:43 pm

I'd guess the file was save in MS Word 2003 has an xml not odf in the first instance.

Have a read of this blog, it explains how too turn it into a normal xml file.

http://blogs.msdn.com/b/brian_jones/arc ... 36647.aspx

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
User avatar
Ram
LXF regular
 
Posts: 1684
Joined: Thu Apr 07, 2005 9:44 pm
Location: Guisborough


Return to Help!

Who is online

Users browsing this forum: No registered users and 0 guests