D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] MS / OpenOffice question.

 

On Wednesday 08 December 2004 11:36 pm, Jon Lawrence wrote:
Hi everyone,
Annoying question time.
I'm trying to get my head around how to get MS word to open OpenOffice xml
files.

That's a separate issue - I'll let someone else answer that because I don't 
have any way of testing it.

I can open word xml files in OO but it seems not the other way around.
This strikes me as strange - don't know why when MS are involved I should
be used to it by now :)

Yes, you should. Why on earth would you think that MS would feel obliged to 
retain import compatibility with OOo, even if it ever existed? It's not 
something MS would want to advertise. Oh, by the way, we support the fastest 
growing free software competitor to the suite you've just bought for £300. 
The marketing dept. would all die on the spot. (on the other hand . . . . )

I'm not saying it doesn't work, just that - like Samba - there is every 
incentive for MS to move the goalposts and not tell the free software 
community. 

I thought that if an xml document was correctly formed then anything that
can open xml documents could open it and work on it - please correct me if
I'm wrong here.

VERY wrong, sorry. XML is not a single format like HTML. It's a language in 
itself. Anyone with a text editor can create an XML format that has no 
relation to any other format. It may be well formed, it may even validate 
against a DTD or Schema - but the importing program still has to make sense 
of the tags, attributes and contents.

PHP can parse any XML file and just display the content. The stage you are 
missing is how a program processes arbitrary input into structures that fit 
with the memory model in use.

e.g. You might think that <account type="visa"/> is self-explanatory - but how 
does an application know how to relate this to existing accounts or visa 
structures?

The process is:
1. Validate the XML
2. Parse the content
3. Relate the parsed content to existing program structures. ('work on it' as 
you describe it.)

It's 3 that is hard.

It's simplicity itself to dump the XML content to the screen - even web 
browsers do it. The hard part comes in making the content work within the 
application.

My guess is that regardless of all the marketing crap I've read about MS
and xml, that word can't actually open/import xml documents correctly.

It can import any XML format that it understands.

If you write a slightly different format of the current OOo XML, it may be 
valid (to your adjusted DTD), it may parse in a generic parser like PHP but 
even OOo won't open it.

Could someone kindly put me out of my misery here.
Can word work with xml documents or not ?

Yes, but no program can do more than simple output of ARBITRARY XML.

There is no such thing as 'The XML' or 'simple XML' or 'BasicXML'. There is a 
framework that defines how XML works but the meaning of the data is left 
entirely to the particular XML format.

I'm hoping that there's an xml guru here abouts that can explain this to
me.

Well, I use XML for fundamental parts of every programming project in current 
development and I've got an XML tutorial at codehelp:
http://www.codehelp.co.uk/html/first.html

It includes how to parse XML with PHP
http://www.codehelp.co.uk/php/xmlparse1.php
(note: this is the simple output method - PHP knows nothing about the nature 
of the content in the XML file, it just dumps it to the output.)

It also includes a little bit on XSLT (before I gave it up as a bad idea)
http://www.codehelp.co.uk/html/glossary1.html

I've created a new XML format called QSF for data communication between 
applications:
http://code.neil.williamsleesmill.me.uk/qsf.html

I'm no guru, but I do use it a lot!

-- 

Neil Williams
=============
http://www.dclug.org.uk/
http://www.nosoftwarepatents.com/
http://sourceforge.net/projects/isbnsearch/
http://www.williamsleesmill.me.uk/
http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3

Attachment: pgp00016.pgp
Description: PGP signature