2 .xml files with identical content behave differently in Excel 2007

New_Alex
New_Alex used Ask the Experts™
on
Hi guys.

I am using Excel 2007 to open the 2 .xml files (included in the attached .Zip)  named "book1.xml" and "book2.xml". Note that the content includes some foreign (greek) characters.

If you open the 2 files in NotePad you will notice that the .xml content is exaclty identical between the 2 files. I know this because I have copied and pasted the content from "book2.xml" into "book1.xml" and saved it.

Despite the identical content, one of the 2 files (the book2.xml) does not open with excel 2007. It gives me an error for some strange reason.  

Can you please tell me what is the difference in the book2.xml that causes it not to open?

Thank you very much.


The-xml-files.zip
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Information Architect
Top Expert 2006
Commented:
I must disagree with your statement that they are equal
book1.xml = 16073 bytes
book2.xml = 8019 bytes
so both files definitely have a different encoding
Whilst copying, notepad made an encoding assumption that was wrong

book1.xml can be opened in an XML editor
book2.xml can not be opened in an XML editor since there is an encoding error

It is a bad idea to open or copy XML stuff in a non XML editor, becuse you are bound to get encoding issues

If I skip the greek characters on opening in Stylus Studio, the file opens well.
So from this I learn that your notepad can't copy the greek characters correctly,
as such breaking the wellformedness of the XML
book1.xml is saved as ANSI - Latin I encoding.
Gertone (Geert Bormans)Information Architect
Top Expert 2006

Commented:
book1.xml can't be ANSI or Latin 1, because it contains double byte encoded Greek Characters, book1.xml is correct UTF-8
book2.xml is defnitely saved as a one byte encoded file, and hex C5 et al. are illegal UTF-8, I am not sure it is ANSI, but it is a single byte encoding

Author

Commented:
Thank you man. This is it......
Gertone (Geert Bormans)Information Architect
Top Expert 2006

Commented:
welcome

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial