Solved

Opening XML-file in Excel, parse-error

Posted on 2014-09-10
2
560 Views
Last Modified: 2014-09-10
Hi

I have a simple XML-file:
<?xml version="1.0" encoding="iso-8859-1" ?>
<rootelement>
  <data>xy & z</data>
</rootelement>

Open in new window

If I open this in Excel 2013 I get a parse-error (cause of the special-character &).
in "http://support.microsoft.com/kb/238833/en-us" I can read that using "Encoding="iso-8859-1" I can use the special characters without encoding. But Excel fires a parse-error. Has I to change an option in Excel or may it be an error in Excel? Other apps like Notepad++ reads the file error-free. Thanks, Peter
0
Comment
Question by:formi
2 Comments
 
LVL 33

Accepted Solution

by:
ste5an earned 500 total points
ID: 40314172
The encoding is not the problem.

It's the specification of XML. There are exactly two characters which must be always escaped, cause they are not allowed as literals in any encoding: & (ampersand) and < (left angle bracket). Use &amp; and &lt; instead of those characters.

See also XML - 2.4 Character Data and Markup.

So you have two options:

<?xml version="1.0" encoding="iso-8859-1" ?>
<rootelement>
  <data>xy &amp; z</data>
</rootelement>

Open in new window


or using the CDATA tag, which makes here normally no sense:

<?xml version="1.0" encoding="iso-8859-1" ?>
<rootelement>
  <data>xy <![CDATA[&]]> z</data>
</rootelement>

Open in new window

0
 

Author Closing Comment

by:formi
ID: 40314207
Thanks for your Information!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question