Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Reading xml file

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
mikejd
LXF regular


Joined: Fri Apr 08, 2005 5:46 pm
Posts: 131
Location: Huntly, Aberdeenshire

PostPosted: Tue Nov 13, 2012 8:13 pm    Post subject: Reading xml file Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Tue Nov 13, 2012 8:52 pm    Post subject: Reply with quote

What does the file command say it is?

Code:
file yourfile.odf

_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
guy
LXF regular


Joined: Thu Apr 07, 2005 1:07 pm
Posts: 1070
Location: Worcestershire

PostPosted: Tue Nov 13, 2012 9:09 pm    Post subject: Reply with quote

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.
_________________
Cheers,
Guy
The eternal help vampire
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Tue Nov 13, 2012 10:12 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
mikejd
LXF regular


Joined: Fri Apr 08, 2005 5:46 pm
Posts: 131
Location: Huntly, Aberdeenshire

PostPosted: Wed Nov 14, 2012 9:38 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Wed Nov 14, 2012 9:52 am    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
mikejd
LXF regular


Joined: Fri Apr 08, 2005 5:46 pm
Posts: 131
Location: Huntly, Aberdeenshire

PostPosted: Wed Nov 14, 2012 12:57 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Wed Nov 14, 2012 1:01 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
mikejd
LXF regular


Joined: Fri Apr 08, 2005 5:46 pm
Posts: 131
Location: Huntly, Aberdeenshire

PostPosted: Wed Nov 14, 2012 1:06 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Wed Nov 14, 2012 1:13 pm    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
mikejd
LXF regular


Joined: Fri Apr 08, 2005 5:46 pm
Posts: 131
Location: Huntly, Aberdeenshire

PostPosted: Wed Nov 14, 2012 1:21 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
Ram
LXF regular


Joined: Thu Apr 07, 2005 10:44 pm
Posts: 1670
Location: Guisborough

PostPosted: Wed Nov 14, 2012 3:43 pm    Post subject: Reply with quote

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/archive/2005/07/07/436647.aspx
_________________

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
Back to top
View user's profile Send private message MSN Messenger
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast