?
Solved

Opening XML-file in Excel, parse-error

Posted on 2014-09-10
2
Medium Priority
?
732 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
ste5an earned 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

766 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